• 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: Creating NSViewController with -init.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating NSViewController with -init.


  • Subject: Re: Creating NSViewController with -init.
  • From: Seth Willits <email@hidden>
  • Date: Mon, 24 Mar 2014 18:36:21 -0700

General advice from my experience:


1. My standard practice has always been to simply override nibName, and call alloc] init]. The majority of the time, view-related properties that need to created that you might normally stick in -initXYZ, I put in -loadView after calling super. (Burn awakeFromNib with fire.)

2. Either call initWithNibName:bundle: or override nibName. Don't rely on NSVC being smart and appropriately grabbing a file with the desired name. Offhand, I believe this is documented to be supported on iOS, but no such documentation or feature exists on OS X. I've (accidentally) experienced it picking a nib automatically on OS X, but it was always picking the wrong nib.



--
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


  • Follow-Ups:
    • Re: Creating NSViewController with -init.
      • From: Uli Kusterer <email@hidden>
References: 
 >Re: Creating NSViewController with -init. (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: Creating NSViewController with -init.
  • Next by Date: Understanding Application crash
  • Previous by thread: Re: Creating NSViewController with -init.
  • Next by thread: Re: Creating NSViewController with -init.
  • Index(es):
    • Date
    • Thread