int main(int argc, const char * argv[]) { @autoreleasepool { NSString * str1 = @"A2"; NSString * str2 = @"a"; NSComparisonResult res = [str1 compare:str2 options:NSNumericSearch]; NSLog(@"%d",res); } return 0; }
程序中标注的句子,后面option NSNumericSearch选项不是只比较字符串的长度么?为什么运行后他的返回值是 -1;?
|