请逐步告诉我iOS的不同视图方法。请说明首先执行哪个方法等。我的意思是说什么时候执行哪个方法?iPhone查看方法
0
A
回答
0
对于您的具体问题,您应该在viewDidLoad中添加子视图。因为,如果你覆盖loadView,你必须完成所有的工作,加载所有的视图。
负载循环过程中发生的步骤的说明如下:
1.
* Some part of your application asks for the view in the view
controller’s view property.
2.
* If the view is not currently in memory, the view controller calls its loadView
method.
3.
* The loadView method does one of the following:
If you override this method, your implementation is
responsible for creating all necessary views and assigning a non-nil value to the view property.
If you do not override this method, the default implementation uses
the nibName and nibBundle properties of the view controller to try to load the view from the specified nib file. If the specified nib file is not found, it looks for a nib file whose name matches the name of the view controller class and loads that file.
If no nib file is available, the method creates an empty UIView object
and assigns it to the view property.
4.
* The view controller calls its viewDidLoad method to perform any
additional load-time tasks.
3
- 初始化或InitWithCode或InitWithNibName或(任何初始化方法)
- 的loadView ///当你有自定义的viewController和加载自定义视图,而不是从nibFile,正常的loadView不叫,只叫
- viewDidLoad中
- viewWillAppear中
- viewDidAppear
上卸载侧
- viewWillDisappear
- viewDidDisappear
- viewDidUnload
- 的dealloc
这些特定于viewController只适用于tableView或其他类型的viewController。如果我缺少任何方法PLZ添加评论。
相关问题
- 1. iPhone - 查看UIViewAnimationTransitionCurlUp
- 2. iPhone的看法
- 3. iPhone:查看加载但无法查看控制器
- 4. iphone查看期号
- 5. iPhone。查看架构
- 6. iphone:查看索引
- 7. iPhone查看动画
- 8. iphone PDF查看CGPDFDocument
- 9. 有什么方法可以在iPhone上查看文件?
- 10. Android查看onResume方法?
- 11. 在getChildView方法中查看
- 12. 改进Django查看方法
- 13. 查看可用的方法
- 14. Mysql查看工作方法?
- 15. 查看可用方法ruby
- 16. 查看数组方法
- 17. 查看Node.js的方法String.prototype?
- 18. 无法在viewDidAppear方法中查看firstResponder
- 19. 查看iPhone的OS X上
- 20. “翘曲”以查看iPhone iOS
- 21. iPhone的Tabbar +查看问题
- 22. iPhone从的TabBar查看
- 23. iPhone - 关闭查看问题
- 24. 推送通知查看iPhone
- 25. 在iPhone上查看动画
- 26. Iphone查看Crul左右
- 27. iPhone - 在iBooks中查看PDF
- 28. iphone重载表查看
- 29. iPhone UIAlertView UIActionSheet表查看
- 30. iphone ui查看组件
这些方法都必须进行相同的调用,以'super'并以正确的方式,否则你会在一个无限循环。创建或显示某些东西的方法先超级,然后做任何事情。删除视图的方法使超级最后的调用成为可能。例如,'viewWillAppear:(BOOL)animated'的第一行应该是'[super viewWillAppear:animate]',而'viewWillDisappear:(BOOL)animated'的最后一行需要是'[super viewWillDisappear:animated]'' 。后者就像在你自己的'dealloc'方法的最后一行调用'[super dealloc]'。 – SK9 2011-03-08 06:14:24
一个简单的方法来说服他们是所谓的顺序自己是做'的NSLog(@“将加载”)','的NSLog(@“做负载”)','的NSLog(@“将出现”) ',...,的NSLog在每个(@“的dealloc”),看看从控制台是什么。 – SK9 2011-03-08 06:15:27
Thanx waqas .. Hw r u? thnx为你的观点。 – 2011-03-08 10:23:09