• 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
Trying to understand -awakeFromNib problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Trying to understand -awakeFromNib problem


  • Subject: Trying to understand -awakeFromNib problem
  • From: Graham Cox <email@hidden>
  • Date: Sun, 25 Oct 2009 22:53:25 +1100

I have, or rather had, a problem. I've solved it but I'm still not sure why the problem is there in the first place.

I have a bunch of controller classes which have a common base class, and this in turn subclasses NSObject. Recently I factored out some code into an even more primitive base class between NSObject and my former base class so I could fork it in another direction. I carefully tested on 10.6 and all was well. Lots of these controllers are instantiated in various nibs.

Then, running on 10.5.(8) I stared to get an error that the object <new class derived from new base class> did not respond to - awakeFromNib. I'd not previously seen this error until I refactored my code. Sure enough my new base class and its new fork don't implement awakeFromNib because they don't need to. On 10.6 there is no error. On 10.5.8 I get the error, suggesting that 10.6 first checks whether - awakeFromNib is implemented and 10.5 does not.

Easy to fix - I added an empty awakeFromNib to the base class and the problem is solved. What I don't understand is that I've never previously been forced to add empty awakeFromNib methods to nib- instantiated classes deriving from NSObject before and they've always opened without a problem on 10.5 and earlier. So what's the difference this time?

--Graham


_______________________________________________

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: Trying to understand -awakeFromNib problem
      • From: Jim Correia <email@hidden>
    • Re: Trying to understand -awakeFromNib problem
      • From: Roland King <email@hidden>
  • Prev by Date: Re: WebView in a layer view hierarchy - not working on Snow Leopard
  • Next by Date: Question about direct vs accessor....PLEASE IGNORE...WILL NOT HAPPEN AGAIN :-) ..APOLOGIES
  • Previous by thread: Re: Why getting two awakeFromNib messages??
  • Next by thread: Re: Trying to understand -awakeFromNib problem
  • Index(es):
    • Date
    • Thread