iOS开发 viewWillAppear:(BOOL)animated真机调试的时候不执行了怎么办

本文转载至http://blog.sina.com.cn/s/blog_a843a8850101e0g7.html

 
现在需要的.h文件里面加上。

然后,在需要的.m文件按里面加上关键代码:
self.navigationController.delegate=self;
再去此时navigationController的代理函数,就可以了。
-(void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
    [viewController viewWillAppear:animated];
}
-(void) viewWillAppear:(BOOL)animated{
    
    NSLog(@"又能成功使用了。");
}
这是其中一个办法。我认为比较合理,就采用了。

灵感来源于http://www.cnblogs.com/zxtx/articles/1806127.html
原文地址:https://www.cnblogs.com/Camier-myNiuer/p/4163950.html