I know that viewWillAppear is not called on pop/push views, but I really need that method. Here is what I try
I added UINavigationControllerDelegate and adopt
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
[viewController viewWillAppear:animated];
}
-(void)viewWillAppear
{
NSLog(@"Log");
}
but viewWillAppear is still not invoked
EDIT
AppDelegate.m
self.navigationController = [[UINavigationController alloc]init];
[self.window setRootViewController:self.navigationController];
FirstView *fview = [FirstView]alloc]init];
[self.viewController pushViewController:fview animated:YES];
FirstView.m
....
-(void)viewWillAppear
{
NSLog(@"Logged");
}
….
The clue is here:
You call a method that takes one parameter. But your method doesn’t have one. In Objective C terms that’s a completely different method.
It should look like this: