码:
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循环仅执行一次。 for循环“返回”某物时是否可能停止?
For循环:for(int sectieId = 0; sectieId
最佳答案
返回后,退出该函数,lopp中断,这就是为什么它仅执行一次的原因。