Comparing version numbers

后端 未结 8 1587
予麋鹿
予麋鹿 2020-12-11 11:39

Some time ago, I read that comparing version numbers can be done using the following code snippet:

NSString *vesrion_1 = @\"1.2.1\";
NSString *version_2 = @\         


        
8条回答
  •  抹茶落季
    2020-12-11 12:05

    From Apple's documentation:

    if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {
        // Load resources for iOS 6.1 or earlier
    } 
    else {
        // Load resources for iOS 7 or later
    }
    

提交回复
热议问题