I do not have a set of sample projects, but I will give you some information about how everything works, and when you should create a controller in a XIB file or in code.
If your controllers are created dynamically using a user action, you usually do not create them in a XIB file. Instead, you will create them in code, for example, mention of harm. Once you do this, you will still need a mechanism to connect this controller, which was created in the code, to the user interface elements that you created in IB.
The mechanism that IB provides to resolve this issue is File Owner. Mastering the file owner is essential for getting the Interface Builder.
, "XIB ", , XIB . , , XIB . NIB , NSBundle - [NSBundle loadNibNamed: ownwer: options:]. owner - XIB/NIB. , , , , , NSBundle. iPhone NIB . UIViewController . loadView UIViewController :
- (void)loadView {
[[self nibBundle] loadNibNamed:[self nibName] owner:self options:nil];
}
, XIB , .
, - . , , . MainWindow.xib. , -.