I want access to the data in a MKMapItem
object. After searching for information, I am asking the community. According to the Apple class reference, there are these properties:
If I log an MKMapItem
I get what appears as a JSON dictionary of dictionaries such as:
Many of the items contain information that I want, which are not default properties of MKMapItem
. Is there a way to parse and model these items? I have tried
NSDictionary *mapItemDictionary = (NSDictionary *)mapItem;
[mapItemDictionary valueForKey:@"key"];
, which results in a crash:
[<MKMapItem 0xb02d830> valueForUndefinedKey:]:
this class is not key value coding-compliant for the key address.
Anna Karenina is correct...
MKmapItem *mapItem = mapItemResponseFromLocalSearch;
NSDictionary *itemAddressDictionary = mapItem.placemark.addressDictionary;
CLLocation *location = mapItem.placemark.location
NSString *name = mapItem.name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With