Re: -[NSWindowController window] fails
Re: -[NSWindowController window] fails
- Subject: Re: -[NSWindowController window] fails
- From: "Kyle Sluder" <email@hidden>
- Date: Fri, 28 Nov 2008 11:13:17 -0500
On Fri, Nov 28, 2008 at 5:06 AM, Alexander Shmelev <email@hidden> wrote:
> - (id) init
> {
> if (![super initWithWindowNibName:@"Dialog"])
> return nil;
> [self window];
> }
1) You never set self. Inside an initializer, you must always set
self to the result of the calling super's designated initializer.
2) Why are you calling -window inside -init? The whole point is that
the window controller doesn't load the nib until necessary (lazy
loading).
--Kyle Sluder
_______________________________________________
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