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 will not receive the -viewWillAppear/viewDidAppear
message, than I found same issue in some thread in stack overflow. After that, I manually call -viewWillAppear/-viewDidAppear
as needed.
but, after upgrade to iOS 5.0
, some frisky UIView
behavior happened. Finally I found that in iOS 5, the [superview addSubView:controller.view]
, will send a -viewWillAppear/-viewDidAppear
message to the controller instance automatically, plus my manually calls, there are two duplicated message each time the controller action its behavior.
and I also found a similar issue: iOS 5 : -viewWillAppear is not called after dismissing the modal in iPad
Now, the problem is, after search apple's documents, I didn't find any explicitly doc for diff about these issues. I even wonder if this is a guaranteed view life cycle behavior in iOS 5.0 .
Does anyone fix similar issues or find some guidelines about these difference. cause I want to run my app both in 4.x & 5.x iOS
.