我通过网上一搜就搜到
http://blog.csdn.net/zhanglei5415/archive/2011/02/17/6191726.aspx
和 http://blog.prosight.me/index.php/2009/11/492
viewDidLoad 此方法只有当view从nib文件初始化的时候才被调用。
loadView 此方法在控制器的view为nil的时候被调用。 此方法用于以编程的方式创建view的时候用到。
幸亏我查了下官方文档啊,不然我就被骗了呀.
引用
viewDidLoad
Called after the controller’s view is loaded into memory.
- (void)viewDidLoad
Discussion
This method is called after the view controller has loaded its associated views into memory. This method is called regardless of whether the views were stored in a nib file or created programmatically in the loadView method. This method is most commonly used to perform additional initialization steps on views that are loaded from nib files.
引用
loadView
Creates the view that the controller manages.
- (void)loadView
Discussion
You should never call this method directly. The view controller calls this method when the view property is requested but is currently nil. If you create your views manually, you must override this method and use it to create your views. If you use Interface Builder to create your views and initialize the view controller—that is, you initialize the view using the initWithNibName:bundle: method, set the nibName and nibBundle properties directly, or create both your views and view controller in Interface Builder—then you must not override this method.
The default implementation of this method looks for valid nib information and uses that information to load the associated nib file. If no nib information is specified, the default implementation creates a plain UIView object and makes it the main view.
If you override this method in order to create your views manually, you should do so and assign the root view of your hierarchy to the view property. (The views you create should be unique instances and should not be shared with any other view controller object.) Your custom implementation of this method should not call super.
If you want to perform any additional initialization of your views, do so in the viewDidLoad method. In iOS 3.0 and later, you should also override the viewDidUnload method to release any references to the view or its contents.
分享到:
相关推荐
loadView和viewDidLoad、viewDidUnLoad区别
主要介绍了IOS 中loadView,viewDidLoad,viewDidUnload详解及使用的相关资料,需要的朋友可以参考下
学长发我的,我无耻的分享给大家了。 希望大家对于那些 viewdidload viewwillappear 的调用顺序有个了解。
主要介绍了详解iOS App开发中UIViewController的loadView方法使用,讲解了访问view属性时loadView方法的调用及使用loadView时的一些注意点,需要的朋友可以参考下
每个ios开发者对loadView和viewDidLoad肯定都很熟悉,虽然这两个函数使用上真的是非常简单,但是和类似的initWithNibName/awakeFromNib/initWithCoder放在一起还是非常容易让人混淆的. 昨天看了下苹果官方的相关文档...
revit二次开发在wpf中显示模型,利用Autodesk 提供的PreviewControl 方法,在wpf界面中显示项目中的某个视图
TKLoadView 自定义LoadView API与APPLE的UIActivityIndicatorView相同,并且我已经提供了协议。
我们加载Listview等,往往需要耗时几秒,这和等待过程加上一些交互效果自然会让人感觉输入一些,常见的转圈圈自不必说,但是按照通常的想法,我们往往是加xml里面的view通过隐藏和现实来实现,这种方式实在不太方便...
*在视图中修改的话就在loadView中 *在AppDelegate中: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 1.关闭键盘: [[IQKeyboardManager ...
在ViewDidLoad或LoadView方法中,设置videoPath 。 它可以是本地路径,也可以是 url。 然后,调用play 。 享受 :)例子- ( void )viewDidLoad { [ super viewDidLoad ]; self. videoPath = [[ NSBundle mainBundle...
builder.setView(loadView()); // 图标 builder.setIcon(android.R.drawable.dialog_holo_light_frame); // 设置确定按钮 builder.setPositiveButton("确定", new android.content.DialogInterface....
swift开发脚手架 github:https://github.com/manondidi/swiftArch 1.基于swift4.2框架组件化 2.rxswift做网络回调处理、mock数据管理 ...6.带EmptyView LoadView ErrorView的TableView和CollectionView ...
LoadMoreHelper 原SwipeLoadView已经改名为LoadMoreHelper,支持更多刷新控件...理论上支持添加任意下拉刷新库的关联,关联后可以解决refresh和load状态的一些处理和冲突等。 默认实现了一套完整的功能,包含SwipeRefre
iOS Widget 开发详解(Today Extension) 疑难杂症记录 interactivePopGestureRecognizer 导致页面卡死 翻译计划 避免 Swift 单元测试中的强制解析 Swift 中的内存泄漏 重写 loadView() 方法使 Swift 视图代码更加...
4.SurfaceView 并不适合作为loadview,这句话并不肯定,因为我没有尝试过其他情况,在我的APP中我用了SurfaceView这个作为loagdview,中间会有些UI不同协同的情况。我并没有舍弃这个控件。正如前面所提的这是个学习...
let loadView = LWTGifLoadView(frame:self.view.frame, callback:{ //网络请求 print("重新请求") }) self.view.addSubview(loadView) ``` github下载:https://github.com/winterLiao/GifLoadView
在单个类中同时支持基于 nib 的模式和基于loadView的模式。 不会在您的应用程序上强加任何类型的图形。 滚动您自己的图形和动画,并使用标准IBAction挂钩或单个超级方法调用发送信号。 如果在...
这个项目是周末对NanoTimeKit框架和Carousel流程的内部工作进行长期研究的结果,该工作的灵感来自在其项目中的工作。 它很大程度上基于的类似(但过时)。 这是如何运作的? 通过劫持_addableFaceCollection的财产...