• 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: devil of a time with an NSImageView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: devil of a time with an NSImageView


  • Subject: Re: devil of a time with an NSImageView
  • From: "I. Savant" <email@hidden>
  • Date: Thu, 20 Aug 2009 10:21:50 -0400

On Aug 20, 2009, at 9:37 AM, Jean-Daniel Dupas wrote:

I managed to find a issue when you don't bind the window outlet and try to call [self window] in awakeFromNib.
Instead of returning nil, it try to load the nib again, falls in a infinite recursive loop and crash when the stack is full. That is the problem I encountered.


Huh. Well sending a -window message to a controller with no window present shouldn't cause the behavior you described, so on its surface, it sure looks like an API bug, but ...

  From the NSNibWaking Protocol Reference:

"An awakeFromNib message is sent to each object loaded from the archive, but only if it can respond to the message, and only after all the objects in the archive have been loaded and initialized. When an object receives an awakeFromNib message, it is guaranteed to have all its outlet instance variables set."

  It also says:

"Important: Because the order in which objects are instantiated from an archive is not guaranteed, your initialization methods should not send messages to other objects in the hierarchy."

For the OP's question, it truly depends on from where -loadWindow is being called, but -awakeFromNib has the final where "is it done yet" is concerned.

I'm not convinced yet that relying on -loadWindow is as good as keeping nib-loading-related startup code in -awakeFromNib.

--
I.S.




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: devil of a time with an NSImageView
      • From: Quincey Morris <email@hidden>
    • Re: devil of a time with an NSImageView
      • From: Jean-Daniel Dupas <email@hidden>
References: 
 >Statements in Replaced Method execute out of sequence - How? (From: Jerry Krinock <email@hidden>)
 >devil of a time with an NSImageView (From: Jack Carbaugh <email@hidden>)
 >Re: devil of a time with an NSImageView (From: Dave DeLong <email@hidden>)
 >Re: devil of a time with an NSImageView (From: Jack Carbaugh <email@hidden>)
 >Re: devil of a time with an NSImageView (From: Quincey Morris <email@hidden>)
 >Re: devil of a time with an NSImageView (From: Jack Carbaugh <email@hidden>)
 >Re: devil of a time with an NSImageView (From: Jean-Daniel Dupas <email@hidden>)
 >Re: devil of a time with an NSImageView (From: "I. Savant" <email@hidden>)
 >Re: devil of a time with an NSImageView (From: Jean-Daniel Dupas <email@hidden>)
 >Re: devil of a time with an NSImageView (From: "I. Savant" <email@hidden>)
 >Re: devil of a time with an NSImageView (From: Jean-Daniel Dupas <email@hidden>)

  • Prev by Date: Re: devil of a time with an NSImageView
  • Next by Date: Re: Heartbeat thread is blocked? -- With Code and Movie
  • Previous by thread: Re: devil of a time with an NSImageView
  • Next by thread: Re: devil of a time with an NSImageView
  • Index(es):
    • Date
    • Thread