UITableViewController的加载方法的逻辑顺序是什么? [英] What is the logical order of load methods of UITableViewController?

查看:91
本文介绍了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:

  1. viewWillLayoutSubviews
  2. numberOfSectionsInTableView
  3. numberOfRowsInSection
  4. cellForRowAtIndexPath
  5. heightForRowAtIndexPath
  6. viewDidLoad
  7. viewWillAppear
  8. viewDidAppear
  1. viewWillLayoutSubviews
  2. numberOfSectionsInTableView
  3. numberOfRowsInSection
  4. cellForRowAtIndexPath
  5. heightForRowAtIndexPath
  6. viewDidLoad
  7. viewWillAppear
  8. viewDidAppear

请更正此顺序并将其添加到其中.

Please correct this ordering and add to it.

推荐答案

这可能会对您有所帮助.

This may help you.

  1. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆