Re: Cocoa class extension best practice
Re: Cocoa class extension best practice
- Subject: Re: Cocoa class extension best practice
- From: Scott Ribe <email@hidden>
- Date: Wed, 16 Oct 2013 15:58:45 -0600
On Oct 16, 2013, at 3:39 PM, Charles Srstka <email@hidden> wrote:
> 3. (This is the one I'd recommend) Instead of using NSNib, make a subclass of NSWindowController (if your nib defines a window) or NSViewController (if your nib defines a view). Then use either -[NSWindowController initWithWindowNibName:] or -[NSViewController initWithNibName:bundle:] to load the nib. This will produce correct behavior on any version of OS X, including 10.7, and gives you a few other niceties as well.
I'd second this; it's what I've been doing since 10.3 for non-document apps, and it works well. (I didn't even know about the NSNib stuff; I guess we started at different ends of the docs when we first tried to figure this out, you at nibs, and me at window controllers.)
--
Scott Ribe
email@hidden
http://www.elevated-dev.com/
(303) 722-0567 voice
_______________________________________________
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