NSTreeController selection not updating
NSTreeController selection not updating
- Subject: NSTreeController selection not updating
- From: Sam Stigler <email@hidden>
- Date: Mon, 7 May 2007 12:48:18 +1000
Hi,
I'm sorry to be posting so many questions to the list recently; this
app I'm working on is driving me nuts. But on to the question...
Does anyone know of a reason why NSTreeController wouldn't be
updating its "selection" binding? I ask because I have an NSTabView
whose selectedLabel is bound to my NSTreeController's selection
through a value transformer that I wrote, and that value transformer
simply does not ever get called after the program launches. (It gets
called twice in succession before I've even selected anything in the
bound outline view, thus returning a NO SELECTION MARKER each time.
I'm using [selection valueForKey:@"observedObject"]. ) I know when
the transformer is called because I put a breakpoint right at the
beginning of it.
At first I thought the problem might be with my transformer, but
then I decided to (without undoing the binding) make an IBAction for
my outline view that basically does the same thing as the binding and
the transformer. 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. The code I'm
getting the NO SELECTION MARKER for in my IBAction is: id
selectedItem = [[theTree selection] valueForKey:@"observedObject"]; .
The binding for the NSOutlineView is: content = (search results)
NSTreeController . arrangedObjects .
The attributes for the NSTreeController are:
Entity Name: OutlineGrouping
Automatically prepares content, Editable, Preserves selected,
Selects inserted objects, doesn't always use multiple values marker
Children key path and leaf key path are specified; count key path
and predicate aren't.
Its only binding is to MyDocument's managedObjectContext.
Thanks again,
Sam
_______________________________________________
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