Skip to content

Instantly share code, notes, and snippets.

@bobmoff
Created September 20, 2012 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bobmoff/3755061 to your computer and use it in GitHub Desktop.
Save bobmoff/3755061 to your computer and use it in GitHub Desktop.
Heres how to manually set the Street name (title) etc on the Callout when using the new Apple Maps for directions.
NSDictionary *addressDict = @{(NSString *)kABPersonAddressStreetKey : @"THIS IS THE NAME OF THE STREET YOU WOULD LIKE TO SHOW"};
MKPlacemark *mapPlaceMark = [[MKPlacemark alloc] initWithCoordinate:placeMarkCoordinate addressDictionary:addressDict];
MKMapItem *mkMapItem = [[MKMapItemClass alloc] initWithPlacemark:mapPlaceMark];
NSMutableDictionary *launchOptions = [[NSMutableDictionary alloc] init];
[launchOptions setObject:MKLaunchOptionsDirectionsModeDriving forKey:MKLaunchOptionsDirectionsModeKey];
[mkMapItem openInMapsWithLaunchOptions:launchOptions];
// U need to import the native Addressbook framework as well to access the kABPersonAddressStreetKey constant which is set during runtime, i guess.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment