• 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
Re: Loading multiple NIBs == multiple awakeFromNib calls
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Loading multiple NIBs == multiple awakeFromNib calls


  • Subject: Re: Loading multiple NIBs == multiple awakeFromNib calls
  • From: John Lombardo <email@hidden>
  • Date: Wed, 22 Oct 2003 16:18:29 +0800

Meh, I forgot to check the mailing list. Looks like testing to see if the
first awakeFromNib call has done something already seems to be the accepted
technique.

John

On 22/10/03 3:20 PM, "John Lombardo" <email@hidden> wrote:

> What's the best way to prevent awakeFromNib being called more than once when
> loading subsequent NIB files?
>
> My main class includes in its init...
>
> // Contains the main window
> if (![NSBundle loadNibNamed:@"KKGenericWindow" owner:self])
> NSLog(@"Error loading Nib named:%@!", @"KKGenericWindow");
>
> // Contains specific elements for each subclass
> if (![NSBundle loadNibNamed:[self className] owner:self])
> NSLog(@"Error loading Nib named:%@!", [self className]);
>
> As the owner for both is self, awakeFromNib gets called twice. Means of
> working around this that have occurred to me include a flag that gets set
> once the method has been called the first time. Is there a better way to
> do/avoid this?
>
> Cheers,
> John
> _______________________________________________
> 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.
_______________________________________________
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.

References: 
 >Loading multiple NIBs == multiple awakeFromNib calls (From: John Lombardo <email@hidden>)

  • Prev by Date: Re: Aqua-style custom views
  • Next by Date: Re: Use of protocols (for DO) crashing gcc3
  • Previous by thread: Loading multiple NIBs == multiple awakeFromNib calls
  • Next by thread: NSThreadWillExitNotification, Thread and notification
  • Index(es):
    • Date
    • Thread