I have an odd case - a view controller that creates its own view in loadView and which is then added to an existing view.
Here is the code that creates and adds VC:
self.doneButtonViewController = [[DoneButtonViewController alloc] init]; [self.view addSubview:self.doneButtonViewController.view];
This code is executed in the viewDidLoad "parent" VC.
It is odd that the added VC's viewWillAppear method is never called (and is not equal to viewDidAppear ), but the added VC's viewWillDisappear method is called (at the appropriate time), as one expected.
Any clue on why viewWillAppear not called?
ios cocoa-touch uiviewcontroller
Hot licks
source share