• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Subclass of NSWindowController doesn't initialize correctly from initWithWindowNibName
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Category method "selector not recognized"
  • Next by Date: Re: What's the fastest way to get icons for file/folders?
  • Previous by thread: Re: Category method "selector not recognized"
  • Next by thread: hex string for long
  • Index(es):
    • Date
    • Thread