Re: -[NSWindowController window] fails
Re: -[NSWindowController window] fails
- Subject: Re: -[NSWindowController window] fails
- From: Andy Lee <email@hidden>
- Date: Fri, 28 Nov 2008 12:50:08 -0800
On Nov 28, 2008, at 10:12 AM, Alexander Shmelev wrote:
- (id) init
{
if (![super initWithWindowNibName:@"Dialog"])
return nil;
[self window];
// there is a lot of code here
return self;
}
I haven't been following this thread, but I believe someone pointed
out you should assign to self, because [super
initWithWindowNibName:@"Dialog"] might return a different object than
the receiver. Something like:
if (!(self = [super initWithWindowNibName:@"Dialog"]))
return nil;
[self window];
// etc.
Might not be relevant to your problem, but it's worth doing correctly.
--Andy
_______________________________________________
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