UIViewController lifecycle
http://stackoverflow.com/questions/5107604/can-somebody-explain-the-process-of-a-uiviewcontroller-birth-which-method-follo
From http://stackoverflow.com/questions/6757018/why-am-i-having-to-manually-set-my-views-frame-in-viewdidload
It helps to understand what happens when a view controller's view is loaded and displayed:
Something accesses your view controller's view property for the first time. This may occur in your own code, or in UIKit in response to a user action like selecting a tab.
UIKit lazy-loads your view controller's view by calling loadView if it's defined, or by loading the view from the NIB that was specified in initWithNibName:bundle:. If neither exists, UIKit just loads an empty view.
UIKit calls viewDidLoad once the view and its subviews have been fully loaded. At this point the view's frame will be whatever it was set to in the NIB, or in loadView.
Something calls for UIKit to display your view controller's view. Again, this may be a user action like tapping on a tab, or an explicit method call in your code like pushViewController:animated: orpresentModalViewController:animated:.
UIKit resizes the view based on the context in which it will be presented, as described above.
UIKit calls viewWillAppear:. The frame should now be the size that will be displayed.
UIKit displays the view, with or without animations.
UIKit calls viewDidAppear:.













