Outlets Not Connected In awakeFromNib
Outlets Not Connected In awakeFromNib
- Subject: Outlets Not Connected In awakeFromNib
- From: Andreas Grosam <email@hidden>
- Date: Wed, 02 Mar 2011 10:54:12 +0100
I have a very basic custom UIViewController with its own associated nib file. This view controller is the "root view controller" of a Navigation Controller which is itself embedded within a Split View Controller which is defined in another nib - say the main.nib.
Within IB this root view controller has its "Nib Name" property specified, which means that this view controller is defined in an extern nib file.
This scenario is the standard way for defining nibs and view controllers when using a Navigation Controller.
To illustrate an example for the main.nib:
File's Owner
First Responder
Window
App Delegate
Split View Controller
Navigation Controller
Navigation Bar
Root View Controller -> Nib Name = "MyRootViewController.nib"
Detail View Controller
My root view controller also defines some properly specified outlets - for instance a view which is embedded within the same nib file and referenced via an outlet from the class.
During -awakeFromNib for the root view controller, none of these kind of outlets are connected. This is quite confusing, since the documentation explicitly says otherwise.
On the other hand, another outlet which references another object (in this case Detail View Controller) which is embedded within the main.nib has been properly connected - which seems to match the documentation.
So, it appears, -awakeFromNib is sent to the files owner (the root view controller) although the nib isn't really loaded and also isn't really properly instantiated from the nib.
It has to be mentioned, at the time when -viewDidLoad is sent to the file's owner the connections have been connected by IB properly.
Reading the documentation carefully, I don't expect awakeFromNib to be sent to a file's owner when not all of its outlets have been properly connected.
Regards
Andreas_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden