Monday, November 29, 2010

UIViewController viewWillAppear not called

If you add the view of a UITabBarController as subview to another view controller. When you tap the tab bar to swap in a new view, viewWillAppear of that view's controller will not be called. This causes problem because many times you use viewWillAppear to refresh a view managed by UITabBarController.

One workaround is to subclass UIView for the view you want to update, and move the stuff from viewWillAppear to drawRect.

No comments:

Post a Comment