2015-03-13 75 views
5

我正在創建一個使用CoreData存儲興趣點的應用程序。在mapItem.placemark.location內可訪問MKMapItem座標。我想提取個別的緯度和經度座標,並將它們作爲double s存儲在managedObjectContext中。我會怎麼做?如何從MKMapItem中提取緯度/經度座標

回答

7

對於每一個簡單的問題,有一個簡單的答案:

mapItem.placemark.location.coordinate.latitude 
mapItem.placemark.location.coordinate.longitude