저는 Apple의지도로 두 곳의 경로를 표시하려고합니다.MKPlacemark의 표시 이름을 설정하는 방법은 무엇입니까?
두 곳은 이름과 좌표가 있습니다.
MKMapItem *currentLocation = [[MKMapItem alloc]
initWithPlacemark:[[MKPlacemark alloc]
initWithCoordinate:paramModel.fromCoordinate2D
addressDictionary:nil]];
MKMapItem *toLocation = [[MKMapItem alloc]
initWithPlacemark:[[MKPlacemark alloc]
initWithCoordinate:paramModel.toCoordinate2D
addressDictionary:nil]];
return [MKMapItem openMapsWithItems:@[ currentLocation, toLocation ]
launchOptions:@{
MKLaunchOptionsDirectionsModeKey :
MKLaunchOptionsDirectionsModeDriving
}];
이 이름은 paramModel
안에 저장됩니다.
나는 이것을 addressDictionary
을 사용하여 얻을 수 있다고 가정합니까? kABPersonAddressStreetKey
과 kABPersonAddressCityKey
을 시도했지만 어느 것도 최종 경로보기에 표시되지 않습니다.
미안하지만 'title'과'subtitle' 필드는'readonly'입니까? –