通过地图获取方向';我不能使用iOS 7

通过地图获取方向';我不能使用iOS 7,ios,map,mkmapview,ios7,mkannotationview,Ios,Map,Mkmapview,Ios7,Mkannotationview,我调用此方法是为了在Apple Map上引导用户。它在iOS 6上运行良好,但现在在iOS 7上无法运行。那么,问题出在哪里呢 -(void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control{ lat1 = [[view annotation]coordinate].latitude; lon1 = [[v

我调用此方法是为了在Apple Map上引导用户。它在iOS 6上运行良好,但现在在iOS 7上无法运行。那么,问题出在哪里呢

-(void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control{

lat1 = [[view annotation]coordinate].latitude;
lon1 = [[view annotation]coordinate].longitude;

NSString *str = [NSString stringWithFormat:@"http://maps.apple.com/maps?saddr=%f,%f&daddr=%f,%f", lat1,lon1,lat,lon];    

NSURL *URL = [NSURL URLWithString:str];

[[UIApplication sharedApplication] openURL:URL];

}
更新

-(void)direct:(id)sender{

CLLocationCoordinate2D coordinate;
coordinate.latitude = 40.896056;
coordinate.longitude = 29.217947;

MKPlacemark *mPlacemark = [[[MKPlacemark alloc] initWithCoordinate:coordinate addressDictionary:nil] autorelease];
MKMapItem *mapItem = [[MKMapItem alloc] initWithPlacemark:mPlacemark];
[mapItem openInMapsWithLaunchOptions:@{MKLaunchOptionsDirectionsModeKey  : MKLaunchOptionsDirectionsModeDriving}];
}
您应该在iOS 6及以上版本上使用

MKPlacemark *placemark = [[MKPlacemark alloc] initWithCoordinate:[view annotation]coordinate]] addressDictionary:nil];
MKMapItem *mapItem = [[MKMapItem alloc] initWithPlacemark:placemark];
[mapItem openInMapsWithLaunchOptions:@{MKLaunchOptionsDirectionsModeKey  : MKLaunchOptionsDirectionsModeDriving}];

我收到一个问题
[view annotation]坐标]
您能解释一下吗?如果您能发布更多关于这个问题的信息,我可能会提供帮助。为什么要设置两次坐标?@rckoenes即使我设置了一个坐标,它也没有响应。我已经编辑了代码。我只想设置从我的位置到那个坐标的方向。