gpt4 book ai didi

ios - 比较NSMutableArray与indexPath.row中的数字

转载 作者:行者123 更新时间:2023-12-01 17:42:48 24 4
gpt4 key购买 nike

我有一个NSMutableArray,它在编辑TableView时经常被编辑。我想做的是运行检查,查看TableView中的行是否与NSMutableArray中的任何数字匹配,如果匹配,请执行操作。因此,在TableView代码中,我有:

if([thearray containsObject:indexPath.row] {
//perform action here
}

但是我不断收到错误:
Incompatible integer to pointer conversion sending 'NSInteger' (aka 'int') to parameter of type 'id'; 

我在做什么错,我该怎么办?

最佳答案

使用此代码...

if([thearray containsObject:[NSNumber numberWithInt:indexPath.row]]) {
//perform action here
}

关于ios - 比较NSMutableArray与indexPath.row中的数字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13942004/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com