This file contains hidden or 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.3"; | |
NSString *num2 = @"2.5"; | |
NSComparisonResult result = [num1 compare:num2 options:NSNumericSearch]; | |
NSLog(@"result %d", result); | |
-> -1 | |
enum _NSComparisonResult {NSOrderedAscending = -1, NSOrderedSame, NSOrderedDescending}; | |
typedef NSInteger NSComparisonResult; |
沒有留言:
張貼留言