In my ios app, I begin by loading the SecondViewController using the code shown below. When that view controller appears, I also run viewDidAppear as shown in the code snippet below.
That works ok. From there, I load my FifthViewController and do some calculating which needs to be returned to the SecondViewController.
Unfortunately, when I return to SecondViewController via the same exact method, the viewDidAppear method does not run.
Any suggestions on how to fix that would be appreciated.
-(IBAction) loadSecondView:(id)sender
{
NSLog(@"In loadSecondView method \n");
[secondViewController viewDidAppear:YES];
[self clearView];
[self.view insertSubview:secondViewController.view atIndex:1];
}
If you want something to be performed every time after dismissing a viewcontroller, you should use delegate method. It is much more specific than viewDidAppear or viewWillAppear.
Here’s a website where you can get started.