Static cells: Content does not appear

回眸只為那壹抹淺笑 提交于 2019-11-29 08:25:34

For static table views, you must not implement any of the datasource methods. The base implementation of UITableViewController has its own versions of these methods which return the appropriate content by reading the storyboard file. The methods are those which provide the table content, e.g. numberOfRows, numberOfSections, heightForRow, cellForRow and so forth.

In your case, you'd implemented tableView:cellForRowAtIndexPath: and returned empty cells each time. This meant the size of your cells was correct, but the content was gone.

Also, none of the outlets to content in your static table view will be set until after [super viewWillAppear:animated] has been called. They will still be nil at viewDidLoad, where you are calling them from, because the table view hasn't asked for any of it's content at that point.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!