Cocoa manual binding to selection in NSArrayController
If I want to do this manually
I have to do this
I have to do this
[vizController bind:@"runData"
toObject:runsController
withKeyPath:@"selection.self"
options:nil];
My RTFM skills lack the voodoo to find where this is documented. Is there perhaps another way?
Comments
When I was at the Cocoa bootcamp, I asked Aaron Hillegass about doing manual bindings. I specifically asked what the fields in the inspector mapped to in the bind:toObject:withKeyPath:options method call. He told me that essentially the Controller Key field and the Model Key Path field are simply concatenated in a single string with a dot in the middle. So if you Controller Key is "selection" and you Model Key Path is say "name", what actually gets used in the method invokation as the withKeyPath: is @"selection.name".
I don't know if that helps you, but it certainly made more sense to me. I don't understand why apple has two fields in there in the first place, I guess it might seem simpler to some people.
In your example, I think you might be able to cut @"selection.self" to just @"selection" (I can't test that right now since we only use windoze machines at work, but you can give it a try.)
Posted by: Jose Vazquez | March 9, 2007 10:40 AM
Nope. No dice. The .self was added (as a guess, no less) because .selection doesn't work.
Exception obj = *** -[_NSControllerObjectProxy graph]: selector not recognized [self = 0x1bb57f0]
Posted by: Jonathan Saggau | March 10, 2007 10:13 PM