在iOS 4.x或更低版本中,viewDidAppear和viewWillAppear,viewDidDisappear和viewWillDisappear,这样的ViewController的委托方法没有被调用.相同的方法与iOS 5.x相同.
为什么?是iOS 4.x或更低版本的错误.因为在iOS 5.x中,所有这些方法都以适当的方式和顺序被调用.
提前致谢,
Mrunal
解决方法
对于
IOS4.x,我使用这样的UINavigationController委托方法:
-(void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated { if (SYSTEM_VERSION_LESS_THAN(@"5.0")) { [activeView viewDidAppear:YES]; } } -(void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated { if (SYSTEM_VERSION_LESS_THAN(@"5.0")) { [activeView viewWillAppear:YES]; } }
我希望这有帮助!