How to pull out latitude/longitude coordinates from MKMapItem
Asked Answered
S

1

10

I'm creating an app that uses CoreData to store points of interest. MKMapItem coordinates are accessible within mapItem.placemark.location. I'd like to pull out the individual latitude and longitude coordinates and store them in a managedObjectContext as doubles. How would I do that?

Symer answered 13/3, 2015 at 14:31 Comment(0)
S
17

For every easy question, there's an easy answer:

mapItem.placemark.location.coordinate.latitude
mapItem.placemark.location.coordinate.longitude
Symer answered 13/3, 2015 at 14:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.