NSArrayController bound to @unionOfArrays not updating
NSArrayController bound to @unionOfArrays not updating
- Subject: NSArrayController bound to @unionOfArrays not updating
- From: "William Towe" <email@hidden>
- Date: Wed, 16 Apr 2008 17:48:17 -0400
This is my first post to the list, I've been using it as a reference for
quite some time and usually I can find a solution to my problems, but
searching didn't turn anything up that applied to my current issue. So
here's the gist of it:
I'm working on an IDE for z80 calculator programmers, and have tried to
model some of the interface after Xcode's (where appropriate of course). I
have an NSOutlineView on the left hand side that mirrors the project
directory structure (a little different than Xcode, but the same general
idea) which is bound via bindings to an array of my file node objects. Then
I have an NSTableView on the right hand side that shows the files in the
currently selected folder from the outline view and includes all the files
within folders of that folder (just like Xcode).
To achieve this I bound the table view's contentArray binding to controller
key "selection" and model key path: "@unionOfArrays.allDescendantsNodes".
The allDescendantNodes method in my file node class returns an array with
all its descendants in it as well as itself. This works as I expected, all
the nodes are shown belonging to the selected folder(s), the folder objects
themselves are filtered out and if a single file is selected it is the only
thing shown in the table view. The problem arises when I insert objects
into the childNodes array of the currently selected folder (this happens
when the user imports existing files into the project); the outline view
updates as it should, showing the new items in their parent's folder, but
the table view does not update. If i change the selection in the outline
view and then click back on the folder, the new files are show correctly in
the table view, but I would like it show up without the user having to
change the selection. All the insertions are done with KVC compliant
methods, so I'm kind of baffled.
Did I miss something setting up the bindings in IB? Or perhaps it is
something else? Any help is very much appreciated.
-William Towe
_______________________________________________
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