In one of the views I launch programmatically, I see 5 different calls to 'loadView/viewdidLoad' but I don't understand why this many are getting called. Can someone explain to me the mechanics behind this?
I launch the view in the parent UIViewController (part of a TabBar + NavigationBar application) instance in the following manner:
MainEditController *editController = [[MainEditController alloc] initWithNibName:@"MainEditView" bundle:nil];
[self.navigationController pushViewController:editController animated:YES];
[editController release];
I then log MainEditController's viewDidLoad and loadView methods (and invoking their respective super methods).
The 'MainEditView' nib contains 3 items: -File's Owner (of type MainEditController), -First Responder (of type UIResponder) -View (of type UIView)
The view outlet is connected to the File's Owner and the View has no elements in it. What I intend to do is add several subs views to the main view and display one of the subviews based on a specific condition.
I thought both viewDidLoad and loadView would get called as many views (1 in this case) within the controller but that doesn't seem to be a valid assumption.