I'm assuming you are correctly storing values in myMutableArray
as NSNumber
s.
If you need to know the position in myMutableArray
, use indexOfObject:
:
NSUInteger position = [myMutableArray indexOfObject:@(indexPath.row)];
if (position != NSNotFound) {
// handle object appearing in the array
}
If you just need to know whether the object appears in the array, use containsObject:
:
if ([myMutableArray containsObject:@(indexPath.row)]) {
// handle object appearing in the array
}