It's been a long time in my mind, and I really don't know how to correctly add a view controlled by a view controller to another view controller view.
This does not work because the view does not finish loading
self.messageViewController = [[PopupMessagesViewController alloc] initWithNibName:@"PopupMessagesViewController" bundle:nil]; [self.view addSubview:self.messageViewController.view];
How can I add the UIView created by the view controller from the nib element to another view manager view? How can I make such a view load before adding it?
. iOS 5 , . iOS 5 / (... , , ) . Container View Controller , , Apple. . , , , . :
: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIViewController_Class/Reference/Reference.html - :
, , : http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/ViewLoadingandUnloading/ViewLoadingandUnloading.html#//apple_ref/doc/uid/TP40007457-CH10-SW1
View Controller.... : http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007457-CH1-SW1
, . , UIViewControllers, . , subview UIViewController, .
iOS 5 UIViewController, , .
try it
- (void)viewWillAppear: (BOOL)animated { [super viewWillAppear: animated]; [self.messageViewController viewWillAppear]; } - (void)viewDidAppear: (BOOL)animated { [super viewDidAppear: animated]; [self.messageViewController viewDidAppear]; }