1

展开 UItableView 部分时出现以下错误,基本上,该部分会将单元格行添加到当前部分并折叠先前展开的部分的单元格行。

 [xtable beginUpdates];
[xtable insertRowsAtIndexPaths:indexPathsToInsert withRowAnimation:insertAnimation];


 [xtable deleteRowsAtIndexPaths:indexPathsToDelete withRowAnimation:deleteAnimation];
[xtable  endUpdates];





  2012-06-29 00:47:11.953 [9869:207] *** Assertion failure in
  -[UIViewAnimation initWithView:indexPath:endRect:endAlpha:startFraction:endFraction:curve:
    animateFromCurrentPosition:shouldDeleteAfterAnimation:editing:], /SourceCache/UIKit_Sim/UIKit-1912.3/UITableViewSupport.m:2522

看起来错误来自动画?

动画部分是这样的

UITableViewRowAnimation insertAnimation;
UITableViewRowAnimation deleteAnimation;
if (previousOpenSectionIndex == NSNotFound || sectionOpened < previousOpenSectionIndex) {
    insertAnimation =UITableViewRowAnimationTop;
    deleteAnimation =UITableViewRowAnimationBottom;
}
else {
    insertAnimation =UITableViewRowAnimationBottom;
    deleteAnimation =UITableViewRowAnimationTop;
}

我注释掉了动画代码,但它仍然给出了与动画相关的相同错误。

4

0 回答 0