Re: Sanity Check
Re: Sanity Check
- Subject: Re: Sanity Check
- From: email@hidden
- Date: Thu, 8 Jul 2010 08:19:41 -0600
his seems weird. Why assign the panel/window to your own ivar when
this is exactly -[NSWindowController window] is designed to do for
you?
I was thinking I might need to reference it and rather than call for
it just have it hanging around. Yes, no?
-koko
On Jul 8, 2010, at 4:44 AM, Mike Abdullah wrote:
On 7 Jul 2010, at 21:07, email@hidden wrote:
Does this code make sense? Where
[[ SewAndColorController alloc] initWithWindowNibName:@"nibName"]
is called from another view action?
@interface SewAndColorController : NSWindowController {
NSPanel *m_panel;
}
@end
#import "SewAndColorController.h"
@implementation SewAndColorController
- (id) initWithWindowNibName:(NSString*)windowNibName
{
self = [super initWithWindowNibName:windowNibName];
if (self != nil)
{
[self retain];
m_panel = [self window];
[m_panel setDelegate:self];
[m_panel makeKeyAndOrderFront:self];
This seems weird. Why assign the panel/window to your own ivar when
this is exactly -[NSWindowController window] is designed to do for
you?
}
return self;
}
@end
_______________________________________________
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