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-& ...
随机推荐
- LINQ to SQL语句(4)之Join
适用场景:在我们表关系中有一对一关系,一对多关系,多对多关系等.对各个表之间的关系,就用这些实现对多个表的操作. 说明:在Join操作中,分别为Join(Join查询), SelectMany(Sel ...
- 找到多个与名为“Login”的控制器匹配的类型
添加了mvc区域以后,可能出现以下错误... 找到多个与名为“Login”的控制器匹配的类型.如果为此请求(“{controller}/{action}/{id}”)提供服务的路由在搜索匹配此请求的控 ...
- Visual Studio 2015正式企业(Enterprise)版
“7月20日 23:30 Visual Studio 2015正式版正式发布,作为微软新一代开发利器,在全地球乃至全宇宙乃至全太阳系中最强大 且没有之一的IDE(上述描述来自微博用户评论)跨平台支持成 ...
- jQuery使用FormData上传文件
这段时间,一直练习在ASP.NET MVC程序中上传文件.静态,动态,单个或多文件上传. 在网上有看到网友提及使用FormData来上传,Insus.NET觉得是一个很不错的方式. 控制器中,创建两个 ...
- JS通过身份证号码获取出生年月日
这里我们讲述一下关于jq根据身份证号码计算出生日期.年龄.性别,有需要的同学可参考一下. 代码如下 复制代码 //获取输入身份证号码 var UUserCard = $("#UUser ...
- windows下用eclipse+goclipse插件+gdb搭建go语言开发调试环境
windows下用eclipse+goclipse插件+gdb搭建go语言开发调试环境 http://rongmayisheng.com/post/windows%E4%B8%8B%E7%94%A ...
- Xcode push带有cocoapods类库的项目到git仓库
关于git之一点不熟悉,以前公司的项目搭建,版本控制这块,都是有专门的人在做,当然那时候也是用的git项目中也包含了cocoapods类库,当前公司比较闲, 所以研究了下git,用的是git.osch ...
- IT职业思考 谈谈IT外包公司
个人能力强才是王道 1. 为什么像BAT.HP.IBM.华为这些大公司还需要外包,他们已经有那么多的技术人员 一个公司,如果没有那么多项目,光养这些技术人员,实际的经营成本确实不低,但是这些技术人员又 ...
- 读书笔记系列之java性能优化权威指南 一 第一章
主题:java性能优化权威指南 pdf 版本:英文版 Java Performance Tuning 忽略:(0~24页)Performance+Acknowledge 1.Strategies, A ...
- shell脚本(管理守护进程)
工作中常常会遇到处理消息队列的消费者进程,这样的进程是一个守护进程,即一个服务.服务通常写个shell脚本来管理,查询服务的status ,启动start 关闭stop 重启reload.最近在学 ...