loadView: only called when a property of the form nil . Use this when creating views programmatically. default: create a UIView object without peeping. For ex -
- (void)loadView { UIView *view = [[UIView alloc] initWithFrame:[UIScreen mainScreen].applicationFrame]; [view setBackgroundColor:color]; self.view = view; [view release]; }
By implementing the loadView: method, you are connected to the default memory management behavior. If memory is low, the view controller may receive a didReceiveMemoryWarning message. The default implementation checks if the view is being used. If its view is not in the view hierarchy, and the view controller implements the loadView: method, its view will be released. Later, when a view is needed, the loadView: method is loadView: again to create the view.
Not sure why you want to use loadView: but you can do as much in viewDidLoad:
Link -
Hope this helps.
Srikar appalaraju
source share