MGSplitViewController.m -viewWillAppear:animated causing master and child controllers own -viewWillAppear:animated methods to be called twice. #56

lemonkey opened this Issue Apr 10, 2012 · 2 comments


None yet

1 participant

I'm seeing cases where whenever an instance of MGSplitViewController is presented, the MGSplitViewController instance's -viewWillAppear:animated method is called.

Within this method, there is logic that will call -viewWlilAppear:animated on both the masterViewController and the detailViewController, even though they will have already been sent this message as being children of the MGSplitViewController. The code as it stands now causes the child view controllers' -viewWillAppear:animated to be called twice.

This can be an issue if you're expecting -viewWillAppear:animated to be called once per event for the view controllers inside either master or detail.

Note: this is confirmed in iOS 5.

ghost commented May 21, 2012

This should fix the issue, iOS 5 automatically forwards appearance and rotation methods to child view controllers.

-(BOOL)automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers {
   return NO;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment