Re: dealloc not called? (Now: NIB chaos ... ;-))
Re: dealloc not called? (Now: NIB chaos ... ;-))
- Subject: Re: dealloc not called? (Now: NIB chaos ... ;-))
- From: Manfred Lippert <email@hidden>
- Date: Sat, 09 Feb 2002 16:26:04 +0100
>
I can see 2 reasons:
>
>
- You load the NIB twice.
You are right! I got the code from some example code, and it does strange
things ...
The about box with its window etc. is in a separate nib (aboutbox.nib). But
in the mainmenu.nib there is also an instance of the about box seen, and the
"About App ..." menu entry is connected with an Action on this about box
("ShowAboutBox"). In this Action (in the code) the about box is created with
[NSBundle loadNibNamed:@"AboutBox" owner:self];
a second time (now from the right nib) if it realizes that there are
non-initialized instance variables that cannot be initialized from the
mainmenu.nib.
awakeFromNib therefore is called twice: First on instanciating the about box
from the menu item for calling ShowAboutBox and a second time when loading
the "complete" about box from the right nib inside the ShowAboutBox action
call.
Very strange! - But how can I change it? I have no idea how to "call" an
Action in another nib ...
What is the "official" way for doing such things?
Do I have to merge the mainmenu.nib and the aboutbox.nib?
Thanks,
Mani
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.