简体   繁体   English

ios,未调用tableview cellForRowAtIndexPath

[英]ios, tableview cellForRowAtIndexPath not called

  func tableView(tableView: UITableView, numberOfRowsInSection section: Int) 

is getting called and returning non zero value. 正在被调用并返回非零值。

but the following code isn't getting called.. why? 但是下面的代码没有被调用..为什么呢?

 func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell

tableView is initially 0 size, and supposed to grow dynamically, would it be the cause of this? tableView最初的大小为0,并且应该动态增长,这是否是原因?

cellForRowAtIndexPath will not be called if tableView's size is zero! 如果tableView的大小为零,则不会调用cellForRowAtIndexPath!
And you must not keep any logical part in that method. 并且您一定不能在该方法中保留任何逻辑部分。 You must use that method only for updating the ui, no more. 您只能使用该方法来更新ui,而不能再使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM