• 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: Multiple Observations
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple Observations


  • Subject: Re: Multiple Observations
  • From: Seth Willits <email@hidden>
  • Date: Sat, 15 Jun 2013 10:16:02 -0700

Adding onto what's been said already, even without the view-based tableview case, the fact that awakeFromNib can be called multiple times is why I generally never use it. Yeeears ago I was bitten by a view controller subclass have its awakeFromNib being called twice because it was instantiated in a nib and loaded another nib. (Although I avoid it now, I suspect this pattern is going to become more common like it already is on iOS — see the case of popovers in nibs.) This is why in every view controller subclass I never use awakeFromNib, but instead override loadView and do work there after calling super.

(I haven't though through it all, but off the top of my head I don't think I can think of any reason why awakeFromNib would actually ever be the "correct" place to put code?)


--
Seth Willits




_______________________________________________

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


References: 
 >Re: Multiple Observations (From: Gordon Apple <email@hidden>)

  • Prev by Date: Re: Multiple Observations
  • Next by Date: Re: Multiple Observations
  • Previous by thread: Re: Multiple Observations
  • Next by thread: Re: Multiple Observations
  • Index(es):
    • Date
    • Thread