awakeFromNib called twice !
awakeFromNib called twice !
- Subject: awakeFromNib called twice !
- From: kubernan <email@hidden>
- Date: Sun, 2 Dec 2001 09:48:19 +0100
Hello,
I decided to rewrite my multi windows app from scratch and i have a very
strange pb :
i discovered my awakeFromNib is called twice !
Here a sample of my code :
---------------
Controller.m
- (IBAction)createFunction:(id)sender
{
id ctrl = [myCreateController new];
if (![NSBundle loadNibNamed:@"Create" owner:ctrl]) {
NSLog(@"Can't launch : Create.nib");
[self release];
}
}
---- myCreateController.m ---------
- (void)awakeFromNib
{
int windowId;
windowId = [myParentWindow windowNumber];
NSLog(@"window number = %d ", windowId);
}
During the execution i have this log when i open only one window:
window number = 380
window number = 0 <---- Big pb.
I have another pb, maybe there is a link ; when i open the two same
windows and a program function is called
for resizing the first window, the rezise is applied for the second
window !
Have an idea ?
Thx for your help.
Kub.