UITableView的执行流程是怎么样的


  1. numberOfSectionsInTableView: 返回TableView的section数目

  2. tableView:titleForHeaderInSection: section1是否有表头标题栏

  3. tableView:numberOfRowsInSection: 设置section1中行数

  1. tableView:heightForRowAtIndexPath: 设置section1中row1行的高度……row2行的高度……逐行设置,直至当前section1属性设置完毕
  1. tableView:titleForHeaderInSection: section2是否有表头栏,之后同4-5,设置section2的属性.同理,设置完毕所有的section的相关属性
  1. tableView:cellForRowAtIndexPath: 接下来设置的是每个section中每row添加的数据

这样整个TableView就设置完毕了.