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");
 }];
kb920
  • 3,039
  • 2
  • 33
  • 44
michaelsmith
  • 1,011
  • 1
  • 16
  • 35
  • I'm with the same problem. Found any solution? – GGirotto Jul 15 '17 at 17:13
  • Yes, opened a developer support ticket with apple. They found out that using Crittercism had the side effect to make MKDirections not work anymore. Have moved to Crashlytics meanwhile. Much better. – michaelsmith Jul 16 '17 at 18:25

0 Answers0