【发布时间】:2018-10-11 06:10:41
【问题描述】:
我尝试了TableView中的reload方法
[self.tableview reloadData];
也试过了
for (int i = 0; i<self->allMessageKey.count; i++) {
NSIndexSet *sec = [NSIndexSet indexSetWithIndex:i];
[self->chatTableView beginUpdates];
//NSIndexPath *section = [NSIndexPath indexPathForRow:NSNotFound inSection:i];
[self->chatTableView insertSections:sec withRowAnimation:UITableViewRowAnimationBottom];
if (i == self->allMessageKey.count-1)
{
[self->chatTableView endUpdates];
NSIndexPath *ip = [NSIndexPath indexPathForRow:NSNotFound inSection:self->allMessageKey.count-1];
[self->chatTableView scrollToRowAtIndexPath:ip atScrollPosition:UITableViewScrollPositionNone animated:NO];
}
}
数据没有在 tableview 中重新加载。我该怎么做?
【问题讨论】:
-
你能解释一下没有单元格的部分吗?
-
哪里可以重新加载tableview?
-
你应该添加更多关于你的代码的细节。我们只能看到您如何尝试重新加载,但看不到您如何设置 TableView 的变量和委托
标签: ios objective-c uitableview