如何在Apple Maps Route上更改注释标题
我用MKMapItem创建了一个从A到B的路径,但我无法在地图上更改注释的标题。 我的代码:
CLLocation *locationRestaurante = [[CLLocation alloc] initWithLatitude:[[[listaRestaurante objectAtIndex:0] objectForKey:@"latitude"] floatValue] longitude:[[[listaRestaurante objectAtIndex:0] objectForKey:@"longitude"] floatValue]]; MKPlacemark *place = [[MKPlacemark alloc] initWithCoordinate:locationRestaurante.coordinate addressDictionary:nil]; MKMapItem *mapItem = [[MKMapItem alloc]initWithPlacemark:place]; NSDictionary *options = @{MKLaunchOptionsDirectionsModeKey:MKLaunchOptionsDirectionsModeDriving}; [mapItem openInMapsWithLaunchOptions:options];
它打开一切都很好……但是只有一个问题:我不能改变这个注释名称:
mapItem.name = @"Place name";
MKMapItem类参考