search

Home  >  Q&A  >  body text

ios - tableview 只执行numberOfRowsInSection,不执行cellForRowAtIndexPath代理方法

tableview是用storyboard创建的,我在代码中执行[self.tableView reloadData];
执行numberOfRowsInSection的时候返回的值是 value > 0 的。但是不执行cellForRowAtIndexPath方法。

代理也已经设置好。

PHPzPHPz2890 days ago856

reply all(5)I'll reply

  • ringa_lee

    ringa_lee2017-04-17 17:56:21

    Is it true that the cellForRowAtIndexPath function is not used? You can stop and take a look. Is it possible that you didn’t notice that he was gone

    reply
    0
  • 阿神

    阿神2017-04-17 17:56:21

    Is [self.tableView reloadData] not written in the main thread?

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 17:56:21

    Are you sure it is cellForRowAtIndexPath? If you take a closer look, you may be confused. There is another function that is very similar to this one

    reply
    0
  • 黄舟

    黄舟2017-04-17 17:56:21

    I happen to also encounter this problem, did you solve it? How to solve it?

    reply
    0
  • 阿神

    阿神2017-04-17 17:56:21

    Under what circumstances is data reloaded? If it is downloaded asynchronously, it must be returned to the main thread to refresh.

    reply
    0
  • Cancelreply