Re: programmatically instantiating bound view/controller
Re: programmatically instantiating bound view/controller
- Subject: Re: programmatically instantiating bound view/controller
- From: "Kyle Sluder" <email@hidden>
- Date: Sat, 2 Feb 2008 14:16:22 -0500
On Feb 2, 2008 2:05 PM, Diez B. Roggisch <email@hidden> wrote:
> So the first question is: to make a re-usable view/panel, do I need to
> create a IB Palette? I'd rather avoid that for obvious reasons (I doubt
> I ever need that control again) - but will, if I have to.
Nope. You would typically create a new nib that contained just your
view (no windows, just the view) and place your controls in it. Your
window controller (most likely) will be responsible for loading this
nib (which instantiates a new view each time) and placing its view in
the window's view hierarchy.
>
> The second question: once I found a way to create a panel, the question
> of the number of instances arises.
>
> Granted, my robot wont magically grow any new motors over night, so I
> _could_ go and instantiate a panel & controller for each of them.
> However, I was wondering if there is a way to instantiate a panel + a
> controller. As said above, providing a controller with a new
> data-backing object seems to be easy, but I've got no idea if and how I
> can re-create the bindings for my new panel instance.
If you're going to go the multiple-window route (instead of multiple
views in one window), then you should be able to bind through the
File's Owner proxy object without issue. There should be no need to
recreate any bindings.
HTH,
--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