我的问题是我使用iOS4.1,当我通过的时候viewWillAppear没有被调用
[self.view addSubView:self.mySecondView.view];然后,在第一个视图中,我在ViewDidLoad上分配了第二个视图。我只想在第二个视图上调用ViewWillApear,因为我想动态执行任务。
他们的选择是什么.因为InitWithNibName方法也会在alloc和init发生时触发。当我添加到该视图时,我想触发一些方法。
谢谢
发布于 2011-04-21 03:23:28
同样的问题之前已经讨论过了,只需通过下面的SO链接。
iPhone viewWillAppear not firing
viewDidLoad gets called, viewWillAppear does not get called, view does not appear on screen
http://forums.macrumors.com/showthread.php?t=575530
这是教程的帖子
http://www.idev101.com/code/User_Interface/UINavigationController/viewWillAppear.html
https://stackoverflow.com/questions/5735456
复制相似问题