2012-06-29 29 views
1

我有一段代码扩大部分的单元格行的代码。UITableView扩大部分产生的错误

片段的代码

-(void)sectionHeaderView:(SectionHeaderView*)sectionHeaderView sectionOpened:(NSInteger)sectionOpened { 


SectionInfo *sectionInfo = [self.sectionInfoArray objectAtIndex:sectionOpened]; 

sectionInfo.open = YES; 



    NSInteger countOfRowsToInsert = 5;   
NSMutableArray *indexPathsToInsert = [[NSMutableArray alloc] init]; 
for (NSInteger i = 0; i < countOfRowsToInsert; i++) { 
    [indexPathsToInsert addObject:[NSIndexPath indexPathForRow:i inSection:sectionOpened]]; 
} 


NSMutableArray *indexPathsToDelete = [[NSMutableArray alloc] init]; 

NSInteger previousOpenSectionIndex = self.openSectionIndex; 
if (previousOpenSectionIndex != NSNotFound) { 

    SectionInfo *previousOpenSection = [self.sectionInfoArray objectAtIndex:previousOpenSectionIndex]; 
    previousOpenSection.open = NO; 
    [previousOpenSection.headerView toggleOpenWithUserAction:NO]; 
    NSInteger countOfRowsToDelete = 5;  

    for (NSInteger i = 0; i < countOfRowsToDelete; i++) { 
     [indexPathsToDelete addObject:[NSIndexPath indexPathForRow:i inSection:previousOpenSectionIndex]]; 
    } 
} 

// Style the animation so that there's a smooth flow in either direction. 
UITableViewRowAnimation insertAnimation; 
UITableViewRowAnimation deleteAnimation; 
if (previousOpenSectionIndex == NSNotFound || sectionOpened < previousOpenSectionIndex) { 
    insertAnimation = UITableViewRowAnimationTop; 
    deleteAnimation =UITableViewRowAnimationBottom; 
} 
else { 
    insertAnimation = UITableViewRowAnimationBottom; 
    deleteAnimation = UITableViewRowAnimationTop; 
} 

// Apply the updates. 
[xtable beginUpdates]; 
[xtable insertRowsAtIndexPaths:indexPathsToInsert withRowAnimation:insertAnimation]; 


[xtable deleteRowsAtIndexPaths:indexPathsToDelete withRowAnimation:deleteAnimation]; 
[xtable endUpdates]; 
self.openSectionIndex = sectionOpened; 

}

在xtable更新[:indexPath:endRect:endAlpha:startFraction:endFraction:曲线:animateFromCurrentPosition:shouldDeleteAfterAnimation:编辑 UIViewAnimation initWithView]发生了错误

有什么可能是错的?有任何想法吗?

回答

0
在我的情况

帮助

-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { 
return 0; 
}