1

I`m developing an app that uses MKMapView, and I need it to run in iOS4, iOS5 and iOS6.

My question is, if I develop using the new iOS MapKit features, can someone using iOS4 see things like routing from sourceAddress to destinationAddress?

Moshe
  • 57,511
  • 78
  • 272
  • 425
Fabiano Neumann
  • 101
  • 2
  • 7

3 Answers3

5

Yes and no.

If your write a maps app using iOS 6 features, it won't run on older versions of iOS, unless you check for the existence of those methods.

More generally speaking, the MapKit framework is smart enough to show the iOS 6 maps where appropriate, and to use Google Maps everywhere else. However, you need to avoid using the routing features where it's not supported. So, to abswer your question, users on iOS 4 and 5 will not see the new routing features.

So, if your app doesn't use new maps features, you're totally fine. If it does, you'll need to take steps, such as weak linking and method checking to ensure that your app doesn't try to run new API on older system versions. Running new code on iOS versions that don't support said code will crash, of course.

Moshe
  • 57,511
  • 78
  • 272
  • 425
0

In the documentation, it states which OS versions specific functions work on. I don't have the documentation with me (on a PC currently) but if those methods were added in iOS6 they won't be available in earlier versions. What you can do to work around that is use #ifdef to check the OS version of the user and disable features as necessary.

Please note, that iOS6 is under NDA so questions about specific methods introduced in it should be kept in the Apple Developer Forums.

Edit: #ifdef is not the way to stop it from running. You just have to check for the version of the OS in your app and do something like:

if (os >= 6) sourceAddress stuff
else if ((os >= 5) && (os < 6) ignore sourceAddress stuff
WhoaItsAFactorial
  • 3,538
  • 4
  • 28
  • 45
  • You can't use `#ifdef` in this way; it's a preprocessor directive, so it's evaluated at compile-time. You should use `respondsToSelector:` – Jim Jul 27 '12 at 13:36
  • `#ifdef` is a compile-time function — if you use it to disable features then they'll simply not be in the build, regardless of where it runs. If it leaves code in then it'll always be in. – Tommy Jul 27 '12 at 13:36
  • Thank you! I got it, all I need to know is to check the iOS version, and do convenient version stuff... – Fabiano Neumann Jul 27 '12 at 14:17
0

Please refer the answer given in this post. Should I be worried about rumors that Apple will stop using Google Maps in iOS6?

It has descriptive answer of your question.

Community
  • 1
  • 1
Apurv
  • 17,116
  • 8
  • 51
  • 67