0
我想比較我的didSelectRowAtIndexPath委託方法中的索引路徑與索引路徑數組。比較循環中的indexPaths iphone
for (n=0; n < [tempMutArrray count]; n= n+1){
NSComparisonResult *result = [indexPath compare:[tempMutArray objectAtIndex:n];
//What I want to do is is write an if statement that executes a certain block of code
//if the two index paths are equal, but I cant figure out how to work with an
//NSComparisonResult.
}
雞蛋裏挑骨頭,'NSComparisonResult'是'enum',而不是一個'int'。 – 2010-05-19 14:13:45
不,它不是。 'NSOrdered ...'值是枚舉'_NSComparisonResult'(注意下劃線前綴)的成員,但是'NSComparisonResult'是'NSInteger'的一個typedef,它本身就是一個int類型定義。 – 2010-05-19 14:32:08
道歉,我不知何故忽略了:) *(注意自我:仔細觀察之前挑剔)* – 2010-05-19 14:36:18