CALayer NAN使用自定义UItableviewCell删除UITableView的部分

嗨我不知道在哪里看得更远我完全卡住: 场景:当我离开视图的编辑模式时,我删除了表格的行和部分。 该表由不同的自定义单元组成,这些单元在进入或离开时具有动画 编辑模式。 问题:有时候,我不知道什么时候,我无法重现它,应用程序崩溃与“ CALayerInvalidGeometry',原因:'CALayer position包含NaN:[nan 2.03571e-10]“错误消息。 我现在看了几个小时,但我找不到它的错误,我提供了一些更多的代码,也许任何人都知道它发生在哪里: 我调用tis方法离开表的编辑模式,调用setupDetailEditMode。
- (void)setEditing:(BOOL)editing animated:(BOOL)animated {


if(editing)
{..}
else{

        tableShowEditMode = NO;
    [self setupDetailEditMode];

    [self createPersonTableHeader];
    [self clearAllEmptyFieldsFromArray];
        [self saveUserProfile];

        [super setEditing:editing animated:animated];
        [profileTable setEditing:editing animated:YES];
......}
这段代码是我删除部分的地方....有些部分仍然有行没有问题,因为它们将被删除,删除以下函数中的部分崩溃的最后一行:
part of function **setupDetailEditMode**:
   //Phone Section
    if(removedRowsPhone)

    {
        if(app.isitUserProfile.isitPhone.count == 0)
            [sectionOperationIndexSet addIndex:sectionWorked];

        sectionWorked++;
    }

    //Email Section 
    if(removedRowsEmail)
    {
        if(app.isitUserProfile.isitEmail.count == 0)
            [sectionOperationIndexSet addIndex:sectionWorked];

        sectionWorked++;
    }



    //update table data structur
    [self buildCurrentTableStructure];

    //delete sections <<<<<**here will crash the app sometimes**
    [profileTable deleteSections:sectionOperationIndexSet withRowAnimation:UITableViewRowAnimationFade]; 
我添加了一个随机的自定义单元格我使用可能有一些错误导致layoutsubviews崩溃:
- (void) layoutSubviews {


    [super layoutSubviews];

    if (self.editing)
    {
        primaryField.enabled = YES;

        // (self.editing && !self.showingDeleteConfirmation)
        star1Img.frame = CGRectMake(87.0,30.0,20.0, 20.0);
        star2Img.frame = CGRectMake(111.0,30.0,20.0, 20.0);
        star3Img.frame = CGRectMake(135.0,30.0,20.0, 20.0);
        star4Img.frame = CGRectMake(159.0,30.0,20.0, 20.0);
        star5Img.frame = CGRectMake(183.0,30.0,20.0, 20.0);

        //primaryLabel.frame = CGRectMake(primaryLabel.frame.origin.x, 8.0,180.0 , 17.0);
        primaryField.frame = CGRectMake(primaryField.frame.origin.x, 8.0,180.0 , 17.0);
        secondaryLabel.frame = CGRectMake(secondaryLabel.frame.origin.x,18.0, 65.0 , 21.0);

    }
    else
    {
        primaryField.enabled = NO;

        star1Img.frame = CGRectMake(29.0,27.0,10.0, 10.0);
        star2Img.frame = CGRectMake(39.0,27.0,10.0, 10.0);
        star3Img.frame = CGRectMake(49.0,27.0,10.0, 10.0);
        star4Img.frame = CGRectMake(59.0,27.0,10.0, 10.0);
        star5Img.frame = CGRectMake(69.0,27.0,10.0, 10.0);

        primaryField.frame = CGRectMake(primaryField.frame.origin.x, 14.0,213.0 , 17.0);
        secondaryLabel.frame = CGRectMake(14.0,6.0, 65.0 , 21.0);
    }

} // layoutSubviews*/


- (void) setStarRating:(int) rating
{

    if(rating>=1)
        [star1Img setImage:[UIImage imageNamed:@"goldstar20.png"]];
......}
我非常沮丧atm,因为我无法找到这个bug,如果有人提示或发现错误,那将是非常好的。一切都会有所帮助。谢谢 -Bevo     
已邀请:
我没有仔细查看你的代码,但我曾经有类似的东西。有一种观点已经被释放,但确实想要再次涂漆 - 基本上是保留的东西。很难找到 - 或理解 - 甚至通过探查器。如果在任何地方发生泄漏,您应该查看分析器。     

要回复问题请先登录注册