Created
December 29, 2017 06:34
-
-
Save wuchuwuyou/29599ee2401ed2d2a14ccf8d9a72baf6 to your computer and use it in GitHub Desktop.
版本号比较
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *num1 = @"2.7.14.2345"; | |
NSString *num2 = @"2.12.8.1234"; | |
//2.7.14.2345 | |
// 2.12.8.1234 | |
if ([num1 compare:num2 options:NSNumericSearch] == NSOrderedDescending) { | |
NSLog(@"%@ is bigger",num1); | |
}else | |
{ | |
NSLog(@"%@ is bigger",num2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment