在我在网上找到的教程(例如http://bit.ly/SIXlI5)和 Apple 文档中,都没有提到发布 MKMapItem 或地标。他们需要被释放吗?如果不需要,为什么不呢?地图应用程序会处理所有这些吗?
NSDictionary *address = @{
(NSString *)kABPersonAddressStreetKey: _address.text,
(NSString *)kABPersonAddressCityKey: _city.text,
(NSString *)kABPersonAddressStateKey: _state.text,
(NSString *)kABPersonAddressZIPKey: _zip.text
};
MKPlacemark *place = [[MKPlacemark alloc]
initWithCoordinate:_coords
addressDictionary:address];
MKMapItem *mapItem = [[MKMapItem alloc]initWithPlacemark:place];
NSDictionary *options = @{
MKLaunchOptionsDirectionsModeKey:MKLaunchOptionsDirectionsModeDriving
};
[mapItem openInMapsWithLaunchOptions:options];