Re: Mac OS 10.5 can't find xib-instantiated subclass methods
Re: Mac OS 10.5 can't find xib-instantiated subclass methods
- Subject: Re: Mac OS 10.5 can't find xib-instantiated subclass methods
- From: Jerry Krinock <email@hidden>
- Date: Tue, 8 Dec 2009 20:22:56 -0800
On 2009 Dec 08, at 18:36, Kyle Sluder wrote:
>> Now, since -awakeFromNib is implemented by NSObject
>
> Not before 10.6 it isn't.
Thank you, Kyle. That was the problem, and since the runtime doesn't distinguish between subclass and superclass, the exception logged sent me looking down the wrong track.
I believe that, sometime between Nov 18 and Nov 29, I noticed that my -awakeFromNib implementations were not invoking super, and ignored my grandmother's advice to "never touch working code".
Correct way:
- (void)awakeFromNib {
// Per Discussion in documentation of -[NSObject respondsToSelector:].
// the superclass name in the following must be hard-coded.
if ([NSTableView instancesRespondToSelector:@selector(awakeFromNib)]) {
[super awakeFromNib] ;
}
...
}
_______________________________________________
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