Re: Is it possible to define class from interface builder?
Re: Is it possible to define class from interface builder?
- Subject: Re: Is it possible to define class from interface builder?
- From: Fritz Anderson <email@hidden>
- Date: Wed, 14 Aug 2013 09:53:46 -0500
On 14 Aug 2013, at 6:48 AM, Izak van Langevelde <email@hidden> wrote:
> On 13 aug. 2013, at 20:43, Scott Ribe wrote:
>
>> On Aug 13, 2013, at 12:34 PM, Izak van Langevelde <email@hidden> wrote:
>>
>>> Is there any way to derive a subclass of NSView from this form, so that it can be reused?
>>
>> NSViewController, combined with a window nib containing the form, so you'd instantiate the nib, pull out the content view, and so on?
>
>
> Works for me, but it feels clumsy that entities created in interface builder can only be reused through code.
> I had hoped for a more elegant solution.
I'm curious to know what a more-elegant solution would look like.
Having to write code to ask for a copy of a view is only rational: How would you get a new copy without asking?
NSViewController takes the name+bundle for a NIB. It loads the view and connects it to your subclass object automatically. Your subclass takes it from there.
That looks like the most AppKit (or any other solution) could do for you; Cocoa does everything it knows about, and you code only what's unique to your application.
What more do you envision?
— F
_______________________________________________
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