Quote:
Originally Posted by bgrupczy
First the question:
As far as I understand, the xib File's Owner needs to be set to the class of the view controller. All the I/O needs to go through the File's Owner object, correct?
|
Not always - "File's Owner" should be set to the type of the object that "initWithNib" is being called on. That object should be "outside" of the nib.
For most of Apple's sample templates, MainWindow.xib points to a UIApplication for its owner. You never see the code that calls initWithNib here- it's hidden inside the default behavior.
If you're calling initWithNib yourself, you should make sure the nib file has the correct type set for the owner, or the connections will not be made. If you're using the code
[[MainViewController alloc] initWithNibName:@"MainView" bundle:nil];
then File's Owner should be a "MainViewController."