2015-11-27 40 views
0
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) 

正在調用並返回非零值。ios,tableview cellForRowAtIndexPath not called

但是下面的代碼沒有被調用。爲什麼?

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

的tableView最初是0大小,應該動態地擴展,這將是這個原因嗎?

回答

6

如果tableView的大小爲零,cellForRowAtIndexPath將不會被調用!
而且您不得在該方法中保留任何邏輯部分。您只能使用該方法更新ui,不能再更新。