NSArray * arr=@[@"2",@"3",@"4",@"6",@"5",@"1"];
NSInteger row=[arr indexOfObject:@"9"];
NSLog(@"row===%ld",(long)row);
打印出來的結果就是:row===9223372036854775807
原因是你數組若包含特定元素,返回具體索引,否則返回:9223372036854775807
NSArray * arr=@[@"2",@"3",@"4",@"6",@"5",@"1"];
NSInteger row=[arr indexOfObject:@"9"];
NSLog(@"row===%ld",(long)row);
打印出來的結果就是:row===9223372036854775807
原因是你數組若包含特定元素,返回具體索引,否則返回:9223372036854775807