Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *****Hello everone!
- I have first time used MKDirection calculateDirectionsWithCompletionHandler to find distance between two locations.
- Below is my code:-
- MKDirections *directions =
- [[MKDirections alloc] initWithRequest:request];
- [directions calculateDirectionsWithCompletionHandler:
- ^(MKDirectionsResponse *response, NSError *error) {
- if (error) {
- NSLog(@"Error is%@",error);
- // Handle Error
- } else {
- for (MKRoute *route in response.routes)
- {
- routeDetails=route;
- [self showRoute:response];
- lblDistance.text=[NSString stringWithFormat:@"%.4f meters",route.distance];
- } }
- }];
- I am getting this error for some locations:-
- Error Domain=MKErrorDomain Code=5 "Directions Not Available" UserInfo=0x1e3f30b0 {NSLocalizedFailureReason=A route could not be determined between these locations., NSLocalizedDescription=Directions Not Available, MKDirectionsErrorCode=1, MKErrorGEOError=-403}
- I am not getting the reason why this error is occuring for some locations.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement