UITableView代理方知多少+执行顺序
一、前言
iOS中UITableView是最常用的一个控件。看了一下UITableView的代理:UITableViewDelegate 和 UITableViewDataSource。其中UITableViewDelegate的方法有38个,UITableViewDataSource的方法有11个。下面来简单介绍一下。(方法代码有点多)
二、UITableViewDelegate方法
UITableViewDelegate的38个方法所有的都是可选的。也就是你可以实现,也可以不实现。这里就不一一介绍了,简单的看一下这个图:

三、UITableViewDataSource方法
UITableViewDataSource的11个方法中有2个是必须实现的:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section; - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
简单看一下UITableViewDataSource代理方法:

五、方法执行顺序问题
这里面没有将所有的方法都考虑进去,这里只是对UITableView实例从创建到完全显示进行测试,而且都是常用的方法,实现其他方法其输出内容可能不一样,但整体结构不变。其中包括UITableViewDelegate的:
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"%@",NSStringFromSelector(_cmd));
}
- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section {
NSLog(@"%@",NSStringFromSelector(_cmd));
}
- (void)tableView:(UITableView *)tableView willDisplayFooterView:(UIView *)view forSection:(NSInteger)section {
NSLog(@"%@",NSStringFromSelector(_cmd));
}
- (void)tableView:(UITableView *)tableView didEndDisplayingCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath*)indexPath {
NSLog(@"%@",NSStringFromSelector(_cmd));
}
- (void)tableView:(UITableView *)tableView didEndDisplayingHeaderView:(UIView *)view forSection:(NSInteger)section {
NSLog(@"%@",NSStringFromSelector(_cmd));
}
- (void)tableView:(UITableView *)tableView didEndDisplayingFooterView:(UIView *)view forSection:(NSInteger)section {
NSLog(@"%@",NSStringFromSelector(_cmd));
}
// Variable height support
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"%@",NSStringFromSelector(_cmd));
return ;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
NSLog(@"%@",NSStringFromSelector(_cmd));
return ;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
NSLog(@"%@",NSStringFromSelector(_cmd));
return ;
}
- (nullable UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
NSLog(@"%@",NSStringFromSelector(_cmd));
UILabel *label = [[UILabel alloc] init];
label.text = @"头标题";
return label;
}
- (nullable UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
NSLog(@"%@",NSStringFromSelector(_cmd));
UILabel *label = [UILabel new];
label.text = @"尾标题";
return label;
}
以及UITableViewDataSource的:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
NSLog(@"%@",NSStringFromSelector(_cmd));
return 2;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
cell.textLabel.text = self.contentArray[indexPath.row];
NSLog(@"%@",NSStringFromSelector(_cmd));
return cell;
}
//设置section的个数
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
NSLog(@"----------------------------------------------------------------------%ld",++inde);
NSLog(@"%@",NSStringFromSelector(_cmd));
return 1;
}
- (nullable NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
NSLog(@"%@",NSStringFromSelector(_cmd));
return @"headerTitle";
}
- (nullable NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section {
NSLog(@"%@",NSStringFromSelector(_cmd));
return @"footerTitle";
}
这里我是讲section得个数设置为1,每个section中的row为2。控制台输出结果如下:
-- ::19.042 UITableViewMethodsTest[:] ----------------------------------------------------------------------
-- ::19.042 UITableViewMethodsTest[:] numberOfSectionsInTableView:
-- ::19.042 UITableViewMethodsTest[:] tableView:heightForHeaderInSection:
-- ::19.043 UITableViewMethodsTest[:] tableView:heightForHeaderInSection:
-- ::19.043 UITableViewMethodsTest[:] tableView:heightForFooterInSection:
-- ::19.043 UITableViewMethodsTest[:] tableView:heightForFooterInSection:
-- ::19.043 UITableViewMethodsTest[:] tableView:numberOfRowsInSection:
-- ::19.043 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::19.043 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::19.048 UITableViewMethodsTest[:] ----------------------------------------------------------------------
-- ::19.049 UITableViewMethodsTest[:] numberOfSectionsInTableView:
-- ::19.049 UITableViewMethodsTest[:] tableView:heightForHeaderInSection:
-- ::19.049 UITableViewMethodsTest[:] tableView:heightForHeaderInSection:
-- ::19.049 UITableViewMethodsTest[:] tableView:heightForFooterInSection:
-- ::19.049 UITableViewMethodsTest[:] tableView:heightForFooterInSection:
-- ::19.049 UITableViewMethodsTest[:] tableView:numberOfRowsInSection:
-- ::19.049 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::19.049 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::19.067 UITableViewMethodsTest[:] ----------------------------------------------------------------------
-- ::19.067 UITableViewMethodsTest[:] numberOfSectionsInTableView:
-- ::19.067 UITableViewMethodsTest[:] tableView:heightForHeaderInSection:
-- ::19.067 UITableViewMethodsTest[:] tableView:heightForHeaderInSection:
-- ::19.067 UITableViewMethodsTest[:] tableView:heightForFooterInSection:
-- ::19.067 UITableViewMethodsTest[:] tableView:heightForFooterInSection:
-- ::19.067 UITableViewMethodsTest[:] tableView:numberOfRowsInSection:
-- ::19.067 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::19.067 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::19.070 UITableViewMethodsTest[:] ----------------------------------------------------------------------
-- ::19.070 UITableViewMethodsTest[:] numberOfSectionsInTableView:
-- ::19.070 UITableViewMethodsTest[:] tableView:heightForHeaderInSection:
-- ::19.070 UITableViewMethodsTest[:] tableView:heightForHeaderInSection:
-- ::19.070 UITableViewMethodsTest[:] tableView:heightForFooterInSection:
-- ::19.071 UITableViewMethodsTest[:] tableView:heightForFooterInSection:
-- ::19.071 UITableViewMethodsTest[:] tableView:numberOfRowsInSection:
-- ::19.071 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::19.071 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::19.072 UITableViewMethodsTest[:] tableView:cellForRowAtIndexPath:
-- ::19.073 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::19.073 UITableViewMethodsTest[:] tableView:willDisplayCell:forRowAtIndexPath:
-- ::19.073 UITableViewMethodsTest[:] tableView:cellForRowAtIndexPath:
-- ::19.074 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::19.074 UITableViewMethodsTest[:] tableView:willDisplayCell:forRowAtIndexPath:
-- ::19.074 UITableViewMethodsTest[:] tableView:viewForHeaderInSection:
-- ::19.074 UITableViewMethodsTest[:] tableView:willDisplayHeaderView:forSection:
-- ::19.074 UITableViewMethodsTest[:] tableView:viewForFooterInSection:
-- ::19.074 UITableViewMethodsTest[:] tableView:willDisplayFooterView:forSection:
从结果可知,当我们设置为1个section和一个每个section的row为2的时候,显示出来一个UITableView的实例需要4轮(我这里用numberOfSectionsInTableView:方法做了分割,所以是4轮):
第一轮~第三轮都是一样的:
1、先执行numberOfSectionsInTableView:一次
2、然后执行tableView:heightForHeaderInSection:两次
3、再执行tableView:heightForFooterInSection:两次
4、再执行tableView:numberOfRowsInSection:一次
5、最后执行tableView:heightForRowAtIndexPath:两次
第四轮是这样的:
1、执行numberOfSectionsInTableView:一次
2、执行tableView:heightForHeaderInSection:两次
3、执行tableView:heightForFooterInSection:两次
4、执行tableView:numberOfRowsInSection:一次
5、执行tableView:heightForRowAtIndexPath:两次
前5步和前三轮是一样的
6、执行tableView:cellForRowAtIndexPath:一次
7、执行tableView:heightForRowAtIndexPath:一次
8、执行tableView:willDisplayCell:forRowAtIndexPath:一次
9、10、11是重复6、7、8。(因为是两个row)
12、执行tableView:viewForHeaderInSection:一次
13、执行tableView:willDisplayHeaderView:forSection:一次
14、执行tableView:viewForFooterInSection:一次
15、执行tableView:willDisplayFooterView:forSection:一次
运行结果如下:(有点丑)

当我们把section设置为2,每个section中row行数为3的时候,控制台输出结果如下:
-- ::27.739 UITableViewMethodsTest[:] ----------------------------------------------------------------------
-- ::27.739 UITableViewMethodsTest[:] numberOfSectionsInTableView:
-- ::27.739 UITableViewMethodsTest[:] tableView:heightForHeaderInSection:
-- ::27.739 UITableViewMethodsTest[:] tableView:heightForHeaderInSection:
-- ::27.740 UITableViewMethodsTest[:] tableView:heightForFooterInSection:
-- ::27.740 UITableViewMethodsTest[:] tableView:heightForFooterInSection:
-- ::27.740 UITableViewMethodsTest[:] tableView:numberOfRowsInSection:
-- ::27.740 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.740 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.740 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.740 UITableViewMethodsTest[:] tableView:heightForHeaderInSection:
-- ::27.741 UITableViewMethodsTest[:] tableView:heightForHeaderInSection:
-- ::27.741 UITableViewMethodsTest[:] tableView:heightForFooterInSection:
-- ::27.741 UITableViewMethodsTest[:] tableView:heightForFooterInSection:
-- ::27.741 UITableViewMethodsTest[:] tableView:numberOfRowsInSection:
-- ::27.741 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.741 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.742 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.756 UITableViewMethodsTest[:] ----------------------------------------------------------------------
-- ::27.756 UITableViewMethodsTest[:] numberOfSectionsInTableView:
-- ::27.757 UITableViewMethodsTest[:] tableView:heightForHeaderInSection:
-- ::27.757 UITableViewMethodsTest[:] tableView:heightForHeaderInSection:
-- ::27.757 UITableViewMethodsTest[:] tableView:heightForFooterInSection:
-- ::27.758 UITableViewMethodsTest[:] tableView:heightForFooterInSection:
-- ::27.758 UITableViewMethodsTest[:] tableView:numberOfRowsInSection:
-- ::27.759 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.759 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.759 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.759 UITableViewMethodsTest[:] tableView:heightForHeaderInSection:
-- ::27.760 UITableViewMethodsTest[:] tableView:heightForHeaderInSection:
-- ::27.760 UITableViewMethodsTest[:] tableView:heightForFooterInSection:
-- ::27.760 UITableViewMethodsTest[:] tableView:heightForFooterInSection:
-- ::27.760 UITableViewMethodsTest[:] tableView:numberOfRowsInSection:
-- ::27.761 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.767 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.767 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.769 UITableViewMethodsTest[:] ----------------------------------------------------------------------
-- ::27.769 UITableViewMethodsTest[:] numberOfSectionsInTableView:
-- ::27.770 UITableViewMethodsTest[:] tableView:heightForHeaderInSection:
-- ::27.770 UITableViewMethodsTest[:] tableView:heightForHeaderInSection:
-- ::27.770 UITableViewMethodsTest[:] tableView:heightForFooterInSection:
-- ::27.770 UITableViewMethodsTest[:] tableView:heightForFooterInSection:
-- ::27.771 UITableViewMethodsTest[:] tableView:numberOfRowsInSection:
-- ::27.771 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.771 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.771 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.771 UITableViewMethodsTest[:] tableView:heightForHeaderInSection:
-- ::27.771 UITableViewMethodsTest[:] tableView:heightForHeaderInSection:
-- ::27.771 UITableViewMethodsTest[:] tableView:heightForFooterInSection:
-- ::27.771 UITableViewMethodsTest[:] tableView:heightForFooterInSection:
-- ::27.772 UITableViewMethodsTest[:] tableView:numberOfRowsInSection:
-- ::27.772 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.772 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.772 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.776 UITableViewMethodsTest[:] ----------------------------------------------------------------------
-- ::27.776 UITableViewMethodsTest[:] numberOfSectionsInTableView:
-- ::27.776 UITableViewMethodsTest[:] tableView:heightForHeaderInSection:
-- ::27.777 UITableViewMethodsTest[:] tableView:heightForHeaderInSection:
-- ::27.777 UITableViewMethodsTest[:] tableView:heightForFooterInSection:
-- ::27.777 UITableViewMethodsTest[:] tableView:heightForFooterInSection:
-- ::27.777 UITableViewMethodsTest[:] tableView:numberOfRowsInSection:
-- ::27.777 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.777 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.778 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.778 UITableViewMethodsTest[:] tableView:heightForHeaderInSection:
-- ::27.778 UITableViewMethodsTest[:] tableView:heightForHeaderInSection:
-- ::27.779 UITableViewMethodsTest[:] tableView:heightForFooterInSection:
-- ::27.779 UITableViewMethodsTest[:] tableView:heightForFooterInSection:
-- ::27.779 UITableViewMethodsTest[:] tableView:numberOfRowsInSection:
-- ::27.779 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.780 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.781 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.784 UITableViewMethodsTest[:] tableView:cellForRowAtIndexPath:
-- ::27.785 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.786 UITableViewMethodsTest[:] tableView:willDisplayCell:forRowAtIndexPath:
-- ::27.787 UITableViewMethodsTest[:] tableView:cellForRowAtIndexPath:
-- ::27.787 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.789 UITableViewMethodsTest[:] tableView:willDisplayCell:forRowAtIndexPath:
-- ::27.790 UITableViewMethodsTest[:] tableView:cellForRowAtIndexPath:
-- ::27.790 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.790 UITableViewMethodsTest[:] tableView:willDisplayCell:forRowAtIndexPath:
-- ::27.791 UITableViewMethodsTest[:] tableView:cellForRowAtIndexPath:
-- ::27.791 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.792 UITableViewMethodsTest[:] tableView:willDisplayCell:forRowAtIndexPath:
-- ::27.823 UITableViewMethodsTest[:] tableView:cellForRowAtIndexPath:
-- ::27.824 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.824 UITableViewMethodsTest[:] tableView:willDisplayCell:forRowAtIndexPath:
-- ::27.824 UITableViewMethodsTest[:] tableView:cellForRowAtIndexPath:
-- ::27.825 UITableViewMethodsTest[:] tableView:heightForRowAtIndexPath:
-- ::27.825 UITableViewMethodsTest[:] tableView:willDisplayCell:forRowAtIndexPath:
-- ::27.827 UITableViewMethodsTest[:] tableView:viewForHeaderInSection:
-- ::27.828 UITableViewMethodsTest[:] tableView:willDisplayHeaderView:forSection:
-- ::27.828 UITableViewMethodsTest[:] tableView:viewForFooterInSection:
-- ::27.829 UITableViewMethodsTest[:] tableView:willDisplayFooterView:forSection:
-- ::27.910 UITableViewMethodsTest[:] tableView:viewForHeaderInSection:
-- ::27.911 UITableViewMethodsTest[:] tableView:willDisplayHeaderView:forSection:
-- ::27.911 UITableViewMethodsTest[:] tableView:viewForFooterInSection:
-- ::27.911 UITableViewMethodsTest[:] tableView:willDisplayFooterView:forSection:
这里也是执行了4轮。前3轮一样。不过由于有两个section。
第一轮~第三轮都是一样的:
1、执行numberOfSectionsInTableView:一次
2、执行tableView:heightForHeaderInSection:两次
3、执行tableView:heightForFooterInSection:两次
4、执行tableView:numberOfRowsInSection:一次
5、执行tableView:heightForRowAtIndexPath:三次 (因为每个section中有3个row)
重复执行2~5
完毕。
第四轮:
前面的和前三轮是一致的。后面开始执行
续1、执行tableView:cellForRowAtIndexPath:一次
续2、执行tableView:heightForRowAtIndexPath:一次
续3、执行tableView:willDisplayCell:forRowAtIndexPath:一次
重复执行续1~续3 五次。然后继续执行:
续4、执行tableView:viewForHeaderInSection:一次
续5、执行tableView:willDisplayHeaderView:forSection:一次
续6、执行tableView:viewForFooterInSection:一次
续7、执行tableView:willDisplayFooterView:forSection:一次
重复执行续4~续5一次(因为有两个section,所以执行了两次设置header和footer)
完毕
运行结果:(有点丑)

四、注意点
1、如果在设置header和footer信息的时候,View的优先级高于titile。(Views are preferred over title should you decide to provide both)
2、如果想让header的title或者footer的title显示不一样的样式(颜色,字体大小),可以用自定义view(UILabel)来实现。
3、注意复用单元格。
4、设置headerTitle样式的时候如果这样写:
- (nullable UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
NSLog(@"%@",NSStringFromSelector(_cmd));
static NSString *HEADTITLE = @"headerTitle";
UITableViewHeaderFooterView *titleView = [tableView dequeueReusableHeaderFooterViewWithIdentifier:HEADTITLE];
if (titleView == nil) {
titleView = [[UITableViewHeaderFooterView alloc] initWithReuseIdentifier:HEADTITLE];
}
titleView.textLabel.textColor = [UIColor redColor];
titleView.textLabel.text =@"头部标题";
return titleView;
}
其中的textColor设置无效。此时可以在这里设置:
- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section {
UITableViewHeaderFooterView *vi = (UITableViewHeaderFooterView *)view;
vi.textLabel.textColor = [UIColor redColor];
NSLog(@"%@",NSStringFromSelector(_cmd));
}
此方法是将要显示header的时候调用的。从执行顺序可以看出来tableView:viewForHeaderInsection:在tableView:willDisplayHeaderView:forSection:之前调用。但是我在tableView:willDisplayHeaderView:forSection:里面设置为什么设置无效呢?难道是因为他是自适应的原因么?有知道的可以告诉一下。
UITableView代理方知多少+执行顺序的更多相关文章
- UITableView的全部属性、方法以及代理方法执行顺序,看过之后肯定有收获---董鑫
UITableView-------表视图--继承UIScrollView并遵守NSCoding协议 属性 frame-------------设置控件的位置和大小 backgroundColor-- ...
- tableView代理方法执行顺序
tableView代理方法执行顺序,随着iOS系统版本的不断升级,执行顺序也有所变化 1.iOS7.1中先依次调一遍heightForRow方法再依次调一遍cellForRow方法,在调cellFor ...
- mysql优化必知(mysql的语句执行顺序)
MySQL的语句执行顺序 MySQL的语句一共分为11步,如下图所标注的那样,最先执行的总是FROM操作,最后执行的是LIMIT操作.其中每一个操作都会产生一张虚拟的表,这个虚拟的表作为一个处理的输入 ...
- UIViewController的生命周期及iOS程序执行顺序 和ios6 处理内存警告
当一个视图控制器被创建,并在屏幕上显示的时候. 代码的执行顺序1. alloc 创建对象,分配空间2.init (initWithN ...
- iOS程序执行顺序和UIViewController 的生命周期(整理)
说明:此文是自己的总结笔记,主要参考: iOS程序的启动执行顺序 AppDelegate 及 UIViewController 的生命周期 UIView的生命周期 言叶之庭.jpeg 一. iOS程序 ...
- 浅谈Spring AOP 面向切面编程 最通俗易懂的画图理解AOP、AOP通知执行顺序~
简介 我们都知道,Spring 框架作为后端主流框架之一,最有特点的三部分就是IOC控制反转.依赖注入.以及AOP切面.当然AOP作为一个Spring 的重要组成模块,当然IOC是不依赖于Spring ...
- java-mybaits-013-mybatis-Interceptor-拦截器执行顺序
一.概述 已知拦截器能够拦截四种类型:Executor.ParameterHandler.ResultSetHandler.StatementHandler. 1.1.不同类型拦截器的执行顺序 背景: ...
- MonoBehaviour Lifecycle(生命周期/脚本执行顺序)
脚本执行顺序 前言 搭建一个示例来验证Unity脚本的执行顺序,大概测试以下部分: 物理方面(Physics) 渲染(Scene rendering) 输入事件(InputEvent) 流程图 Uni ...
- Unity中脚本的执行顺序总结(@WhiteTaken)
(Editor)以上是Unity官方文档中的截图,脚本在被挂载到物体上,会启用Editor的方法Reset. (Initialization)当执行脚本开始,初始化的过程中,依次执行的是Awake-& ...
随机推荐
- 深入分析MVC中通过IOC实现Controller依赖注入的原理
这几天利用空闲时间,我将ASP.NET反编译后的源代码并结合园子里几位大侠的写的文章认真的看了一遍,收获颇丰,同时也摘要了一些学习内容,存入了该篇文章:<ASP.NET运行机制图解>,在对 ...
- ios基础之 透过页面跳转来认识 Strong 与 Weak
最近在自己做一个小程序,遇到了页面跳转的问题,然后上网一通乱搜,跳转的问题解决了,又有传值的问题.上面两个问题解决了,又发现内存比刚开始时多占用了2M,于是,各种内心纠结,想彻底 搞清楚strong ...
- [转]virtualenv建立多个Python独立开发环境
不同的人喜欢用不同的方式建立各自的开发环境,但在几乎所有的编程社区,总有一个(或一个以上)开发环境让人更容易接受. 使用不同的开发环境虽然没有什么错误,但有些环境设置更容易进行便利的测试,并做一些重复 ...
- VUE2.0不可忽视的很多变化
今天使用webpack-sample初始一个vue-cli项目,在app.vue文件中添加了个钩子函数ready,可是ready内的事件一直不执行,检查了webpack文件和package.json也 ...
- SQL - 内连接与外连接
PDF下载地址:SQL-内连接与外连接.pdf 连接查询在关系型数据库中经常用到,是多表联合查询的基础. 主要包含:内连接,外连接,交叉连接. SQL - 内连接与外连接 内连接 等值连接 不等值连接 ...
- SQL Server存储过程多角度介绍
什么是存储过程: 存储过程(Procedure)类似于C#语言中的方法,它是SQL语句和控制流语句的预编译集合.存储过程存储在数据库内,可由应用程序通过一个调用执行,而且允许用户声明变量.逻辑控制语句 ...
- MSCRM 获取列表所选记录相关信息
问题:如何通过JS获取列表中所选记录信息? 解决办法: The CRM2011 Ribbon has a special set of parameters called 'CrmParameters ...
- Excel导入数据库脚本
--数据库中不存在需要导入的表 SELECT * INTO tab_PurchasePriceTemp FROM OPENROWSET( 'Microsoft.Jet.OLEDB.4.0', 'EXC ...
- .NET 中获取调用方法名
在写记录日志功能时,需要记录日志调用方所在的模块名.命名空间名.类名以及方法名,想到使用的是反射(涉及到反射请注意性能),但具体是哪一块儿还不了解,于是搜索,整理如下: 需要添加相应的命名空间: us ...
- 原生态的ajax 及json和gson学习资源
@RequestMapping(value = "/{id}/view") @jsobody public String viewProject( @PathVariable(&q ...