我有一个数组,我正在尝试检查 indexPath(.row) 是否存在。
我使用这段代码:
if ([array containsObject:[NSNumber numberWithInt:indexPath.row]]){
NSLog(@"Yep, it exists in there.");
}
该数组由数字 3、8 和 2 组成。索引路径在循环中加载从 0 到 8 的数字。
谁能明白为什么这不起作用?
我有一个数组,我正在尝试检查 indexPath(.row) 是否存在。
我使用这段代码:
if ([array containsObject:[NSNumber numberWithInt:indexPath.row]]){
NSLog(@"Yep, it exists in there.");
}
该数组由数字 3、8 和 2 组成。索引路径在循环中加载从 0 到 8 的数字。
谁能明白为什么这不起作用?