今天遇到这个问题, UITableView 的代理方法 tableView:cellForRowAtIndexPath: 

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;

没调用。

 

有人说可能 delegate 或 dataSource 没有配置,检查了下,都配置了,如下:

self.tableView.delegate=self;
self.tableView.dataSource=self;

 

后来终于找到了原因,原来是 reloadData 方法没调用!

[self.tableView reloadData];

网络请求之后调用下该方法就可以了。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-28
  • 2022-12-23
  • 2021-09-03
  • 2022-12-23
  • 2022-12-23
  • 2021-05-03
相关资源
相似解决方案