Trying to understand -awakeFromNib problem
Trying to understand -awakeFromNib problem
- Subject: Trying to understand -awakeFromNib problem
- From: Graham Cox <email@hidden>
- Date: Sun, 25 Oct 2009 22:53:25 +1100
I have, or rather had, a problem. I've solved it but I'm still not
sure why the problem is there in the first place.
I have a bunch of controller classes which have a common base class,
and this in turn subclasses NSObject. Recently I factored out some
code into an even more primitive base class between NSObject and my
former base class so I could fork it in another direction. I carefully
tested on 10.6 and all was well. Lots of these controllers are
instantiated in various nibs.
Then, running on 10.5.(8) I stared to get an error that the object
<new class derived from new base class> did not respond to -
awakeFromNib. I'd not previously seen this error until I refactored my
code. Sure enough my new base class and its new fork don't implement
awakeFromNib because they don't need to. On 10.6 there is no error. On
10.5.8 I get the error, suggesting that 10.6 first checks whether -
awakeFromNib is implemented and 10.5 does not.
Easy to fix - I added an empty awakeFromNib to the base class and the
problem is solved. What I don't understand is that I've never
previously been forced to add empty awakeFromNib methods to nib-
instantiated classes deriving from NSObject before and they've always
opened without a problem on 10.5 and earlier. So what's the difference
this time?
--Graham
_______________________________________________
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