iOS 5 definitely changed their calls to viewWillAppear
and viewWillDisappear
. For instance, subviews (View Controller's views
as subviews to be exact) in a UIScrollView
, viewWillDisappear
will get called when you push another view controller onto the stack. However, when the view controller is popped, viewWillAppear
does not get called. These methods were never called in iOS 4 on UIScrollView
subviews.
This is strange behavior to me. Couple that with the fact that regardless of what should happen, if you could rely on it happening in iOS 4, it should not be working differently in iOS 5. Most of the time, I have no idea in which particular instance each one is called, I usually trial and error it as I'm in the zone coding. If it works the way I like, I move on. Then iOS 5 comes in and throws a wrecking ball into everything.
I have also experienced when a UINavigationController's
view is a subview, and a ViewController
is pushed on the navigation controller stack, viewWillAppear
never gets called in iOS 4, but does get called in iOS 5. Go figure.