• 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
[SOLVED but...] Re: awakeFromNib called twice !
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SOLVED but...] Re: awakeFromNib called twice !


  • Subject: [SOLVED but...] Re: awakeFromNib called twice !
  • From: kubernan <email@hidden>
  • Date: Sun, 2 Dec 2001 19:56:59 +0100

Thx all for your help,

It works now. I didn't see i had a wrong IB connection of one of my controller...
I deleted this controller and connect the file's owner instead.

But the other pb still exists :
If i display more than one instance of the same window and call a resize function in my program,
the second window is resizing instead of the first one.

First window Second window third window
call resize
I ^
I I
I I
+--- applied here (!)------------+



Here's a part of my code :

------ Create.m ---------
- (id)init {

self = [super init];

if (![NSBundle loadNibNamed:@"CreateWindow" owner:self]) {
NSLog(@"Can't launch : CreateWindow.nib");
[self release];
}

}

- (void)awakeFromNib
{

[myParentWindow makeKeyAndOrderFront:self];
}

-(void)someStuff
{
// some code
if (count > 1)
[self modSize];
}

- (void)modSize
{

if (firstTime)
{
NSRect oldFrame = [myParentWindow frame];
NSRect frame={{oldFrame.origin.x,oldFrame.origin.y-150},{oldFrame.size.width,oldFrame.
size.height+150}};
[myParentWindow setFrame:frame display:YES animate:YES];
firstTime = FALSE;
}
}

- (NSWindow *)myParentWindow
{
return myParentWindow;
}

Le dimanche 2 dicembre 2001, ` 06:20 PM, Vince DeMarco a icrit :

On Sunday, December 2, 2001, at 12:48 am, kubernan wrote:

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 !


awakeFromNib will get called for object that comes out of a nib file. So if this object is the files owner of 2 nib files then it will get called twice,

vince
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev


References: 
 >Re: awakeFromNib called twice ! (From: Vince DeMarco <email@hidden>)

  • Prev by Date: floating point grayscale image?
  • Next by Date: Printing defaults
  • Previous by thread: Re: awakeFromNib called twice !
  • Next by thread: NSUserDefaults and the synchronize: method - doesn't seem to sync...
  • Index(es):
    • Date
    • Thread