Best Way Checking iPhone iOS Version

The best way to compare iPhone iOS Version

if ([[[UIDevice currentDevice] systemVersion] compare:@"6.0" options:NSNumericSearch] == NSOrderedAscending)
    {
        less then iOS 6.0
    }
    else
    {
        iOS 6.0
    }

Avoid Following Methods:
[[UIDevice currentDevice].systemVersion floatValue] (Not work for versions 5.1.2)
[[[UIDevice currentDevice] systemVersion] integerValue] < 5)
[[[UIDevice currentDevice] systemVersion] substringToIndex:0];
[UIDevice currentDevice] systemVersion] isEqualToString:@"6.0"];

Note:
UseFull Macros for checking versions (by yasirmturk) :
#define SYSTEM_VERSION_EQUAL_TO(v)                  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
#define SYSTEM_VERSION_GREATER_THAN(v)              ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN(v)                 ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v)     ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)

4 comments:

  1. whoah this weblog is magnificent i like studying your posts.
    Stay up the great work! You know, many individuals are hunting round for this info, you can
    help them greatly.

    My web blog: book of ra android boerse

    ReplyDelete
  2. Premium Blogger Templates Responsive Blogger and Wordpress Themes premium blogger templates free download

    ReplyDelete
  3. Earn from Ur Website or Blog thr PayOffers.in!

    Hello,

    Nice to e-meet you. A very warm greetings from PayOffers Publisher Team.

    I am Sanaya Publisher Development Manager @ PayOffers Publisher Team.

    I would like to introduce you and invite you to our platform, PayOffers.in which is one of the fastest growing Indian Publisher Network.

    If you're looking for an excellent way to convert your Website / Blog visitors into revenue-generating customers, join the PayOffers.in Publisher Network today!


    Why to join in PayOffers.in Indian Publisher Network?

    * Highest payout Indian Lead, Sale, CPA, CPS, CPI Offers.
    * Only Publisher Network pays Weekly to Publishers.
    * Weekly payments trough Direct Bank Deposit,Paypal.com & Checks.
    * Referral payouts.
    * Best chance to make extra money from your website.

    Join PayOffers.in and earn extra money from your Website / Blog

    http://www.payoffers.in/affiliate_regi.aspx

    If you have any questions in your mind please let us know and you can connect us on the mentioned email ID info@payoffers.in

    I’m looking forward to helping you generate record-breaking profits!

    Thanks for your time, hope to hear from you soon,
    The team at PayOffers.in

    ReplyDelete