programmatically instantiating bound view/controller
programmatically instantiating bound view/controller
- Subject: programmatically instantiating bound view/controller
- From: "Diez B. Roggisch" <email@hidden>
- Date: Sat, 02 Feb 2008 20:05:49 +0100
Hi,
I'm currently facing a situation where google, Hillegass & cocoadev.com
didn't provide any help so far.
I'm writing a roboter control frontend. Part of it will be 8
information/control-panels for the motors found in the robot.
My idea was to subclass a NSView, place some controls in it, create a
NSController (so far not subclassed), bind the controls to some values
and then use the controller's setContent:-method to provide it with the
data-delivering object.
First problem: creating a subclass in interface-builder of a NSView
works fine, instantiating it as well. But placing controls on top of it
doesn't make these appear on other instances placed inside my actual window.
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.
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.
All this happens on OS X 10.4.11, IB 2.5.4 & XCode 2.4.1.
Any help would be appreciated,
Diez B. Roggisch
_______________________________________________
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