Re: Application Architecture or approach
Re: Application Architecture or approach
- Subject: Re: Application Architecture or approach
- From: Graham Cox <email@hidden>
- Date: Thu, 12 Feb 2009 15:11:35 +1100
On 12 Feb 2009, at 3:04 pm, Louis Demers wrote:
I do not care about sticking with that paradigm of one window per
camera, but I'm conformable with that approach. But how to I get all
the sliders and gui elements of my palettes to now bind to the
object/camera that is selected.
In my current app, in the bindings inspector of the gui element, I
select my instantiated object in the bind to popup and enters the
model key path to the key of my object I want to control/display.
That works because the instantiated object in unique and in my
MainMenu.xib.
But in the above scenarios, how do I configure my binding ? the key
is the same all over, but the bound object will be swapped by
whatever selection process I end up using. Or do I have hit a limit
of the binding mechanism. I doubt it, more likely a limit of my own
understanding of bindings 8-)
OK, I understand your question. I'm not in a good position to answer
it definitively as I haven't used bindings myself - I still tend to do
things using KVO directly since my current project predates bindings.
However, in general, I think what you need to is to have a single
controller object that you bind your controls to, and swap the
connection to the data model object that represents the selected
camera. Then when the camera is switched you are changing just that
one object reference, not all the individual bindings. I believe that
generic controllers such as NSArrayController will handle that pretty
much for you - you just bind to 'selection.whatever' (bondage experts
please correct any misinformation here). That could also permit you to
have a multiple selection of cameras and control several
simultaneously if that makes sense for you.
--Graham
_______________________________________________
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