while coding in iOS 4.3 before, I found while add a view controller\'s view to another view with [superview addSubView:controller.view]
, the controller instance wil
view{Will,Did}Appear
, view{Will,Did}Disappear
are functions on View Controllers and not views. These functions are called by SDK provided view controllers that are supposed to manage other view controllers e.g. UITabBarController
, UINavigationBarController
.
If you are managing sub-view controllers yourself, you have to call these explicitly (and in proper order - though you should have a very good reason to do this). A modal view not getting these calls upon dismissal of a modal view is simply because there is no one there to call it. Encapsulate the root view controller in a UINavigationController
(and hide the navigation bar if you like) and then open a modal view controller. Upon its dismissal, or pop, viewWillAppear
will get called.