开发者社区> 问答> 正文

uitableview loadmore点击加载更多的问题

我做了一个点击一行就加载更多,但是出现下面的错误。后来调试

到-(void) appendTableWith:(NSMutableArray *)data这个方法的时候才出错,问下这个代码段那里错了?我附上代码,在末尾就是出错的代码。

发生的错误提示

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Attempt to create two animations for cell';

数据源是array,是空数据,每次点击cell就增加10个数据到displaytenarray,nDownLoad=0

array = [[NSMutableArray alloc]init];

displaytenarray = [[NSMutableArray alloc]init];

  • (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

{

return [displaytenarray count]+1; 

}

UITableViewCell *cell = [[UITableViewCell alloc]

initWithStyle:UITableViewCellStyleDefault

reuseIdentifier:@"moretag"];

screenshot
screenshot
screenshot

展开
收起
杨冬芳 2016-06-24 14:49:53 2462 0
1 条回答
写回答
取消 提交回答
  • IT从业

    建议你通过增加data,然后reload你的tableview就可以
    有可能是你对一个cell同时用了两次动画。比如,我之前是这样的。

        [self.tableView reloadRowsAtIndexPaths:@[ reloadIndex,indexPath] withRowAnimation:UITableViewRowAnimationNone]; 
    

    但是,其实,reloadIndex跟indexPath是一样的。

    2019-07-17 19:46:58
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载