I have a root view controller with subview to be wrappers for views of child view controllers. The basic idea is my root controller has a left and right view controller, both present on screen (similar to a splitviewcontroller). On load a modal view pops up over the root view controller and asks for details. The modal view then contacts a server, and is dismissed after getting a response. The root controller then adds the child view controllers with the following code:
[self addViewController:self.leftViewController];
[self addViewController:self.rightViewController];
[self addView:self.rightViewController.view ToWrapper:self.rightViewWrapper];
[self addView:self.leftViewController.view ToWrapper:self.leftViewWrapper];
Where add view controller is:
[self addChildViewController:controller];
[controller didMoveToParentViewController:self];
and addViewToWrapper just adds the view controller's view to the relevant subview of the rootViewController as follows:
[[viewWrapper.contentView subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)];
newSubview.frame = viewWrapper.contentView.bounds;
newSubview.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
[viewWrapper.contentView addSubview:newSubview];
99% of the time this works fine. Both views appear instantly and viewWillAppear fires in both child controllers. However, occasionally the screen stays white for a brief period and viewWillAppear doesn't fire in the right view controller (EDIT: and the left). All of the other view lifecycle methods fire, just not viewWillAppear.
Unfortunately, I can't give code for the whole class as it is complex and proprietary. But are there any clues in this description for this intermittent behaviour?