1

完全にはわかりませんが、最後の iOS アップデート以降、以下のコードが機能していないようです。calculateDirectionsWithCompletionHandler は応答しません。数時間後、まだ応答していません。

CLLocationCoordinate2D thisone;
thisone.latitude=49;
thisone.longitude=6;

MKPlacemark *pmfrom=[[MKPlacemark alloc]initWithCoordinate:thisone addressDictionary:nil];
MKMapItem *source=[[MKMapItem alloc]initWithPlacemark:pmfrom];
//6.9.0   [source autorelease];[pmfrom autorelease];

thisone.latitude=50;
thisone.longitude=7;
MKPlacemark *pmto=[[MKPlacemark alloc]initWithCoordinate:thisone addressDictionary:nil];
MKMapItem *destination=[[MKMapItem alloc]initWithPlacemark:pmto];

MKDirectionsRequest *request = [[MKDirectionsRequest alloc] init];
request.source = source;
request.destination = destination;
request.requestsAlternateRoutes = YES;
request.departureDate=[NSDate date];
request.transportType=MKDirectionsTransportTypeAutomobile;

MKDirections *directions = [[MKDirections alloc] initWithRequest:request];
[directions calculateDirectionsWithCompletionHandler:
 ^(MKDirectionsResponse *response, NSError *error) {//XC not answering
     NSLog(@"returned");
 }];
4

0 に答える 0