Skip to content

Instantly share code, notes, and snippets.

@wuchuwuyou
Created December 29, 2017 06:34
Show Gist options
  • Save wuchuwuyou/29599ee2401ed2d2a14ccf8d9a72baf6 to your computer and use it in GitHub Desktop.
Save wuchuwuyou/29599ee2401ed2d2a14ccf8d9a72baf6 to your computer and use it in GitHub Desktop.
版本号比较
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