Subclass of NSWindowController doesn't initialize correctly from initWithWindowNibName
Subclass of NSWindowController doesn't initialize correctly from initWithWindowNibName
- Subject: Subclass of NSWindowController doesn't initialize correctly from initWithWindowNibName
- From: Alan Condit <email@hidden>
- Date: Fri, 18 Aug 2006 11:13:11 -0700
I have subclassed NSWindowController.
The call to create and initialize my custom controller is this:
aPriorityController = [[PriorityController alloc]
initWithWindowNibName:@"Priority" andAPriority:CurPriority];
Here is the invoked method in the subclass:
- (id) initWithWindowNibName:(NSString *)aNibName andAPriority:
(Priority *)aPriority
{
self = [super initWithWindowNibName:aNibName owner:self];
if (self) {
// Add your subclass-specific initialization here.
CurPriority = aPriority;
// If an error occurs here, send a [self release] message and
return nil.
}
return( self );
}
If I run in the debugger and step through the call,
aPriorityController is initialized with the nib name but the window
pointer is nil and all the IBOutlets are nil.
awakeFromNib is called twice once with with a different address than
the object that I alloc(ed) and once with the object that I alloc
(ed). In the first call (self) has an address that I don't recognize,
owner is set to that address and the nibName is nil, but it has a
valid window pointer and all of the IBOutlets are initialized. In the
second call (self) has the address that I alloc(ed), has the nib
name, and my CurPriority pointer but the window pointer is nil and
all the IBOutlets are nil.
Can anyone give me a clue what is going on?
Thanks,
Alan
_______________________________________________
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