Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8624175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:27:35+00:00 2026-06-12T07:27:35+00:00

I want to make our app compatible with iOS6’s MKDirectionsRequest (Transit Directions method). Apple

  • 0

I want to make our app compatible with iOS6’s MKDirectionsRequest (Transit Directions method). Apple states the best way to do this is:

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
    if ([MKDirectionsRequest isDirectionsRequestURL:url]){
        }
}

However, what is the best way to ensure this code is only run when the app is running in iOS6, and not iOS5? The app HAS to be compatible with iOS5 as well, but I MKDirectionsRequest is an iOS6.

I can’t use compiler directives like:

#ifdefine iOS5

or anything.

Is this the best way?

BOOL atLeastIOS6 = [[[UIDevice currentDevice] systemVersion] floatValue] >= 6.0;

and then:

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
    {

        if (atLeastIOS6)
        {
            if ([MKDirectionsRequest isDirectionsRequestURL:url]){
            }
        }
    }

I just want to make sure I don’t crash on iOS5 when checking for openURLs

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T07:27:36+00:00Added an answer on June 12, 2026 at 7:27 am

    I have seen numerous posts that discouraged using the system version string. It might have to do with trickiness converting 6.0.1 to a float, but not sure.

    The preferred method seems to be to test a selector that appeared in a specific version. As such, I use these two methods to test for iOS 5 or 6 respectively.

    + (BOOL)isOS5Capable {
    
        return ( [UINavigationBar respondsToSelector:@selector(appearance)] );
    
    }
    
    + (BOOL)isOS6Capable {
    
        return ( [UIView respondsToSelector:@selector(requiresConstraintBasedLayout)] );
    
    }
    

    If you look through the headers in the Apple frameworks, you will see that there are quite a few NS_AVAILABLE macros that specify what version the selector appeared. To create this function for iOS 6, I hunted around for a few minutes to find a static method to simplify the check (so I wouldn’t have to allocate a class). By following this practice, you should be able to ensure that your app is version safe for future updates.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use Gama component in Android to make our app good.I have
I have a application written in wxPython which I want to make multilingual. Our
If we want in our WPF application to let a user make a SQL
I am new android app developer i want make app for tablets and phone
I want to make a tableview containing our stores - sectioned by city. The
I'm going to develop an iPhone app, and want to make sure what I
Our company have some data in excels/images files that we want to make available
We are shopping for Business Rules Engines. We want to make our core application
On our app we use secure function that make id in the road in
I need to make sure that our iPhone App (implemented with Monotouch) will still

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.