1

I am not totally sure, but it looks like code below is not working anymore since the last ios update. the calculateDirectionsWithCompletionHandler is never answering: hours later it still hasnt responded.

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