2

I'm trying to add direction on map by using google api,I have followed this link for displaying route on maps Drawing a route in MapKit in iPhone SDK

it is working fine , now the problem is when i search for source and destionation in different countries app is going to crash saying *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid Region '.

Community
  • 1
  • 1

1 Answers1

0

I can think of two solutions:

Community
  • 1
  • 1
Ashraf Tawfeeq
  • 3,036
  • 1
  • 20
  • 34
  • Thaks for your reply but I want to display any alert if user selectes different countries as source and destinations ,so what should i do to compare –  Feb 02 '15 at 06:44
  • Check if the source and destination have the same country code or name that will insure that both points are in the same country. Therefore you can route else alert the user. – Ashraf Tawfeeq Feb 02 '15 at 06:58
  • You can benefit from this answer here http://stackoverflow.com/questions/14576289/get-current-city-and-country-from-clgeocoder – Ashraf Tawfeeq Feb 02 '15 at 07:55