UIViewController生命周期需要注意的
2015-08-25 14:15
501 查看
@property(nonatomic,retain)
UIView *view;
// The getter first invokes [self loadView] if the view hasn't been set yet. Subclasses must call super if they override the setter or getter.
如果没有生成view,那么self.view会先调用[self loadView],然后。。。
(void)viewDidLoad;
// Called after the view has been loaded. For view controllers created in code, this is after -loadView. For view controllers unarchived from a nib, this is after the view is set.
然后调用viewDidLoad,注意this is after -loadView.
总结,self.view->[self loadView]->[self viewDidLoad]。
UIView *view;
// The getter first invokes [self loadView] if the view hasn't been set yet. Subclasses must call super if they override the setter or getter.
如果没有生成view,那么self.view会先调用[self loadView],然后。。。
(void)viewDidLoad;
// Called after the view has been loaded. For view controllers created in code, this is after -loadView. For view controllers unarchived from a nib, this is after the view is set.
然后调用viewDidLoad,注意this is after -loadView.
总结,self.view->[self loadView]->[self viewDidLoad]。
相关文章推荐
- UIView(包括子类)的几个初始化时执行动作的时机
- POJ 1141 Brackets Sequence (DP)
- leetcode 之 Unique Paths
- 关于android uid 与进程的关系
- POJ 1788 Building a New Depot(水~)
- iOS 并发编程之 Operation Queues
- UITableView的registerClass forCellReuseIdentifier用法详解
- UI第二讲UITextField和UIButton
- 报错: Access restriction:The type JPEGCodec is not accessible due to restriction on required library
- 关于Qt5 使用QQuickWidget加载QML背景设置透明的问题!
- 动态修改ui2dsprite的图片
- rpmbuild打包qwt
- UI第一讲UIView和UILabel
- SVN问题: configure: error: subversion requires zlib
- ueditor 结合easyui使用
- scu oj 4443 Range Query (scoure :2015年四川省acm省赛)
- 如何对使用了autolayout的UIView添加动画
- MySQL Query Cache
- 理解Automatically selecting local only mode for query本地模式
- Ubuntu编译openwrt时出现Parser perl module is required for intltool 问题