Re: monitoring changes in a local property
Re: monitoring changes in a local property
- Subject: Re: monitoring changes in a local property
- From: Koen van der Drift <email@hidden>
- Date: Tue, 08 May 2012 08:03:06 -0400
On Tue, May 8, 2012 at 12:27 AM, Quincey Morris
<email@hidden> wrote:
> It's not obvious why you need a "mySelection" property at all.
It's used in a master-detail setup in my application. Briefly, my
application has the familiar Mail layout: A column (outlineview) on
the left with groups, then a column (tableview) in the middle showing
the entities from a selected group, and on the right two panes which
show details about the selected entity. One of the panes on the right
swaps views (using the example code from Hillegass' book). So I am
using 'mySelection' (I probably could also use 'myEntity') so the
viewcontroller for each of these views knows what data to show. I hope
this makes sense.
> P.S. Personally, I wouldn't bind to a NSArrayController like this, because
> it just obscures the MVC lines of your app. The array controller is getting
> its content from somewhere: from this view controller itself, from a window
> controller, or from the app delegate. Assuming the last of these (based on
> your description of the data as app-wide), then I'd give the app delegate a
> "selectionIndexes" property (of type NSIndexSet*), bind the array
> controller's "selectionIndexes" binding to this property in IB, and have the
> view controller observe the app delegate "selectionIndexes" property instead
> of the array controller "selectedObjects" property.
That sounds like a good idea and I will see how that fits in my app. I
am indeed using the AppDelegate to switch the views, and pass the
managedobjectcontext around as explained in the book by Hillegass.
But I see now that is not really needed, since the views only show
info about one entity. I just need to make sure that when the user
changes the selection in the middle column, the details are updated in
the right two panes.
Thanks for all the input, lots of food for thought, and again highly
appreciated.
- Koen.
_______________________________________________
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