Skip navigation.
 
mlFinding my way through binding
FROM : Laurent Cerveau
DATE : Thu May 15 15:54:00 2008

Hi

I have a document application with multiple window controllers. The 
document contains an array of objects (custom classes no Core Data 
here), called "entities" (NSMutableArray*) In one of the window,I 
would like to have an NSOutlineView (one column for now) with a 
binding for its content to the array.

So I went through docs and made the following
- create a NSTreeController in the nib files
- establish a binding between the NSOutlineview column value and the 
the NSTreeController arrangedObjects (wih model key path to the an 
accessor of the custom object)
- establish a binding betwen the NSTreeController contentaArray and 
"document.entities" (on File's Owner which is the window controller)

I then try to add an entity through the NSTreeController addObject 
method, and ...nothing happens, except a message in the console that 
says
"Cocoa Bindings: Cannot create NSArray from object NSCFString of class 
NSCFString". The outline view stays empty

If I add the object manually to the "entities" NSArray and then 
reassign the content of the NSTreeController to this array everything 
is fine and displays in the outline view

Besides doing simple examples this is the first time I deal with 
collection binding and here I get lost to where I should look for a 
problem. How can I debug this (and understand what I made wrong and 
why this was wrong)?

Thanks

laurent

Related mailsAuthorDate
mlFinding my way through binding Laurent Cerveau May 15, 15:54
mlRe: Finding my way through binding Hamish Allan May 15, 23:38