Re: NSTreeController selection not updating
Re: NSTreeController selection not updating
- Subject: Re: NSTreeController selection not updating
- From: Sam Stigler <email@hidden>
- Date: Tue, 8 May 2007 02:20:03 +1000
Thanks; your idea about the content binding was right on the mark.
As soon as I removed that (the column was already bound), the value
transformer began to be triggered as it should be. I took a look at
your code; thanks for that. Apparently observedObject just doesn't
work like it used to (as of when the post promoting it on theocacao
was written), and valueForKey:@"observedObject" doesn't seem to work
for subclasses of NSManagedObject, although I haven't yet extensively
played around with implementing a custom subclass for it -- right
now, all I can get my custom accessor to do is call an infinite loop
of itself, when it should be making a call to super. But thanks very
much; you've in one email taken my problem from something seemingly
out-of-control to something somewhat manageable. Thanks for the code
as well; I haven't had time yet to look at it extensively, but I will.
Sam
On May 8, 2007, at 12:54 AM, George Orthwein wrote:
On May 6, 2007, at 10:48 PM, Sam Stigler wrote:
... I got a NO SELECTION MARKER even though I could clearly see
that something was selected in the outline view. Trying it with
the binding removed got the same result....
So it sounds like the problem is that the selection in the outline
view is not setting a selection in the tree controller. You could
set up an IBAction to set the tree controller selection to see if
your value transformer is then triggered.
The binding for the NSOutlineView is: content = (search results)
NSTreeController . arrangedObjects .
If I recall correctly (and that's perhaps a big IF :), when you
specify a content binding you also have to manually specify the
selectionIndexPaths binding of the NSOutlineView to the
NSTreeController's selectionIndexPaths. If you don't specify
content and merely bind the columns of the outline view, then the
selection and content is hooked up automagically based on the first
column.
Oh, found it:
"If you bind the content explicitly rather than binding a column of
the NSOutlineView to the controller, you must also explicitly bind
the selectionIndexPaths and sortDescriptors to the controller."
http://developer.apple.com/documentation/Cocoa/Reference/
CocoaBindingsRef/BindingsText/NSOutlineView.html
I worked on a similar project many months ago. I haven't really
touched it since, so there are many details I don't remember. Maybe
it will help though.
http://www.cocoabuilder.com/archive/message/cocoa/2006/7/6/166974
George
_______________________________________________
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