Skip to content

Instantly share code, notes, and snippets.

@nickcheng
Created September 22, 2013 06:02
Show Gist options
  • Save nickcheng/6657120 to your computer and use it in GitHub Desktop.
Save nickcheng/6657120 to your computer and use it in GitHub Desktop.
Compare version no.
NSString *smallVersion = @"3.8";
NSString *bigVersion = @"3.10";
if ([smallVersion compare:bigVersion options:NSNumericSearch] == NSOrderedAscending) {
NSLog(@"%@ is smaller than %@!", smallVersion, bigVersion);
} else {
NSLog(@"%@ is bigger than %@!", smallVersion, bigVersion);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment