0

代码:

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 < [[self pickAnd] count]; sectieId++)

4

1 回答 1

1

返回后,退出函数并且 lopp 中断,这就是它只执行一次的原因。

于 2012-11-14T16:52:37.240 回答