Re: Newbie: setting a delegate to NSWindow
Re: Newbie: setting a delegate to NSWindow
- Subject: Re: Newbie: setting a delegate to NSWindow
- From: Nick Zitzmann <email@hidden>
- Date: Wed, 9 Mar 2005 22:59:52 -0700
On Mar 9, 2005, at 8:21 PM, Aaron Vegh wrote:
- (id)init
{
[super init];
theWindow = [[NSWindow alloc]init];
[theWindow setDelegate:self];
return self;
}
First of all, you should set self to [super init] and check to make
sure that [super init] doesn't return nil.
Second, you need to use NSWindow's designated initializer rather than
-init, which in the case of NSWindow is
-initWithContentRect:styleMask:backing:defer:. If you use an
initializer other than an object's designated initializer, then the
object may not work correctly.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden