UIViewController viewDidAppear not called after modal close

A UIViewController (View A) calls another view controller (view B), invoking it as a modal control.

[self presentModalViewController: ViewB animated: TRUE];

And view B exists by calling:

[self rejectModalViewControllerAnimated: TRUE];

When this happens, everything looks right. EXCLUDES that View A viewWillAppear and viewDidAppear are not called (they are called when the application starts, though). The strange thing is ... I believe that this has already been done before, but I'm not sure what is happening now.

Is there something clearly wrong that I am doing? Thanks!

* UPDATE * I just found out that this behavior only happens with the transition type UIModalTransitionStylePartialCurl. For all other transition types, the parent view controller receives the viewDidAppear message simply.

So what should I do!?!

+4
source share
1 answer

I just ran into the same problem.

I solved this by adding a delegate and delegate method.

Therefore, when controller A opens controller B as a modal view controller with page curl, I install an instance of controller b's.delegate as controller a.

In controller B, I add the following:

-(void) viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; if (delegate) [delegate didCloseInfoViewController]; } 
+2
source

All Articles