コード:
if(self.editing == YES)
{
if(self.editing == YES && indexPath.section == 7 && indexPath.row == [[self pickGoalsFromAnd:0] count])
{
NSLog(@"INSERT editingStyleForRowAtIndexPath.section: %d", (indexPath.section));
return UITableViewCellEditingStyleInsert;
}
NSLog(@"Net voor FORLUS");
for(int sectieId = 0; sectieId < [[self pickAnd] count]; sectieId++)
{
NSLog(@"Binnen FORLUS , sectieId/pickAndCount: (%d)/(%d)", sectieId, [[self pickAnd] count]);
sectieId = sectieId + 8;
NSLog(@"indexPath.section '==' %d '&&' indexPath.row '==' %d", sectieId , [[self pickGoalsFromAnd:(sectieId-8)] count] );
if(indexPath.section == sectieId && indexPath.row < [[self pickGoalsFromAnd:(sectieId-8)] count])
{
NSLog(@"INSERT editingStyleForRowAtIndexPath.section: %d", (indexPath.section));
return UITableViewCellEditingStyleInsert;
}
else
if(indexPath.section != ([[self pickAnd] count] + 7))
{
{
NSLog(@"ifELSE");
return UITableViewCellEditingStyleDelete;
}
}
}
NSLogs を使用してわかるように、for ループは 1 回だけ実行されます。何かを「返した」ときに for ループが停止する可能性はありますか?
for ループ: for(int sectieId = 0; sectieId < [[self pickAnd] count]; sectieId++)