有关TableView的reload过程分析。

在tableview的区域reload过程中:
[tableview reloadRowsAtIndexPaths:_selectedIndexes withRowAnimation:UITableViewRowAnimationAutomatic];(假设此方法在didsele里面)那么 首先执行的是
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
会将需要显示的cell高度全部遍历一遍

然后 执行
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
会  将需要刷新的cell数据刷新一下
然后 会再执行一遍
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
 返回刚才cellForRowAtIndexPath里面刷新过的cell。
至此刷新完毕。






评论

此博客中的热门博文

使__attribute__((annotate("xxx")))能作用于OC函数

viewWillAppear不执行的解决办法

iOS中使用xpc/xpc.h