0

I'm calling the calculateDirectionsWithCompletionHandler method from MKDirections, but the completion handler is never called. Not even with an error. And since the request is made in the main thread, the entire application gets stuck. I ensure that the directionRequest has source and destination and both locations are not nil. Someone have experienced the same?

[directions calculateDirectionsWithCompletionHandler:^(MKDirectionsResponse * _Nullable response, NSError * _Nullable error) {


    if (error) {

        NSLog(@"%@", error);

    }else{

        // Deal with the response

    }

}];
danh
  • 62,181
  • 10
  • 95
  • 136
GGirotto
  • 848
  • 2
  • 10
  • 31
  • 1
    The most likely cause for the completion handler not being called is if the calculate method isn't called. The most likely cause for that is `directions == nil`. – danh Jul 15 '17 at 19:30
  • Thats the point, directions is not nil. The `MKDirectionRequest` that i am using to instantiate the directions is not nil either. I have no idea whats is happening. – GGirotto Jul 15 '17 at 21:54

0 Answers0