UITableViewController的加载方法的逻辑顺序是什么? [英] What is the logical order of load methods of UITableViewController?
问题描述
执行顺序显示tableView时,UITableViewController方法的逻辑执行顺序是什么?这是我最好的猜测:
What is the logically executed order of a UITableViewController's methods when a segue is performed to show the tableView? Here is my best guess:
-
viewWillLayoutSubviews
-
numberOfSectionsInTableView
-
numberOfRowsInSection
-
cellForRowAtIndexPath
-
heightForRowAtIndexPath
-
viewDidLoad
-
viewWillAppear
-
viewDidAppear
viewWillLayoutSubviews
numberOfSectionsInTableView
numberOfRowsInSection
cellForRowAtIndexPath
heightForRowAtIndexPath
viewDidLoad
viewWillAppear
viewDidAppear
请更正此顺序并将其添加到其中.
Please correct this ordering and add to it.
推荐答案
这可能会对您有所帮助.
This may help you.
-
viewDidLoad
首先加载视图.
viewWillAppear
当再次出现任何视图时,就会调用此方法.
viewWillAppear
As any view appears again then this method is called.
numberOfSectionsInTableView
设置表中的节数.
numberOfRowsInSection
设置节后,此方法确定节中的行数.
numberOfRowsInSection
After setting sections,this method determines number of rows in a section.
heightForRowAtIndexPath
将设置行的高度.
viewWillLayoutSubviews
查看节标题.
cellForRowAtIndexPath
通过这种方法可以创建表格视图的单元格的内容和布局.
cellForRowAtIndexPath
Contents and layout of cell of a tableview is created in this method.
viewDidAppear
这篇关于UITableViewController的加载方法的逻辑顺序是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!