ios,tableview cellForRowAtIndexPath未调用

eug*_*ene 1 tableview ios swift

  func tableView(tableView: UITableView, numberOfRowsInSection section: Int) 
Run Code Online (Sandbox Code Playgroud)

被调用并返回非零值.

但是下面的代码没有被调用..为什么?

 func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
Run Code Online (Sandbox Code Playgroud)

tableView最初为0大小,并且应该动态增长,是否会导致这种情况?

art*_*dev 9

如果tableView的大小为零,则不会调用cellForRowAtIndexPath!
而且你不能在该方法中保留任何逻辑部分.您必须仅使用该方法更新ui,不再需要.