Re: NSViewController subclass return type
Re: NSViewController subclass return type
- Subject: Re: NSViewController subclass return type
- From: Kyle Sluder <email@hidden>
- Date: Wed, 10 Jul 2013 23:26:46 -0700
On Jul 10, 2013, at 11:18 PM, email@hidden wrote:
> Hi all,
>
> Is there an appropriate way to subclass NSViewController to return a custom view class or is casting the return of view or loadView the only way?
I'm not following here. It's generally bad form to override a method for the sole purpose of changing its return type. Just cast the returned value got the appropriate type.
> Is it even worth using on OS X since there are so few built in methods? Is it more practical to just load views from nibs without NSViewController?
NSViewController does correct memory management of all top level object in the job, including breaking retain cycles caused by Cocoa Bindings. It's also an NSResponder subclass, though it doesn't get inserted into the responder chain automatically.
If you'd like to see NSViewController become more than marginally useful, please file Radars.
--Kyle Sluder
_______________________________________________
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