Re: Core Data and "interactive" NSPopUpButtons
Re: Core Data and "interactive" NSPopUpButtons
- Subject: Re: Core Data and "interactive" NSPopUpButtons
- From: "I. Savant" <email@hidden>
- Date: Tue, 16 Jan 2007 19:02:26 -0500
My original thought was to simply not bind the popup to anything,
build the
menu and handle the CoreData interaction manually, but that seems
to defeat
the purpose of bindings/CoreData. Plus, that gets ugly when the user
switches from one entry to the next.
There's nothing wrong with this. Not everything fits neatly into
the Core Data / Cocoa Bindings pattern. There are myriad situations
where the best approach is to roll your own solution.
For instance, you're afraid that it would 'get ugly' when the
selection changes (presumably because the popup sets the path for the
currently-selected object). This is actually trivial. If you have a
reference to your NS*Controller instance, you can ask it for its
current selection and set the appropriate property depending on the
popup's choice.
Regarding setting the property, without using bindings, consider
that the Core Data documentation specifically gives plenty of example
code that changes attributes / relationships of managed objects ...
it's quite common practice.
The point is, NSObjectController / NSArrayController doesn't do
everything for you. :-)
--
I.S.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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