我有以下表格。
我想创建一条规则:
现在,我这样做了:
for (int i = 0; i<self.colors.count; i++) {
SomeColor *currentItem = [self.colors objectAtIndex:i];
if (currentItem.color != orange) {
if (i+1 < self.colors.count) {
nextItem = [self.colors objectAtIndex:i+2];
if (nextItem.color != orange) {
[indexSet addIndex:i+1];
indPath = [NSIndexPath indexPathForRow:i+1 inSection:0];
[inPathArr addObject:indPath];
}else{
nextItem = [self.colors objectAtIndex:i+2];
NSLog(@"Next: %@",[nextItem.mRows objectAtIndex:0]);
[indexSet addIndex:i+2];
indPath = [NSIndexPath indexPathForRow:i+2 inSection:0];
[inPathArr addObject:indPath];
}
}
}
}
感谢您的帮助!!!