I am seriously stuck trying to implement bindings in a program I am writing using xCode 4. Here is what my program is doing:
A sheet attached to a single window appears when the application launches. The sheet contains an NSTableView for selecting services discovered using Bonjour.
Whenever I attempt to run this program, I get the following error:
I don't understand why it is giving me this error because I am not asking for a key path of an array, I am asking for the key path of a dictionary. What am I doing wrong? I've read the Apple KVC guide, the Apple Bindings guide, I've searched this forum, cocoa-dev, cocoadevcentral, cocoadev, Cocoa is my Girlfriend, and Stack Overflow, and I still cannot find my answer. I know I must be missing something simple that I just am not seeing.
A sheet attached to a single window appears when the application launches. The sheet contains an NSTableView for selecting services discovered using Bonjour.
- The sheet's File's Owner is a NSWindowController subclass called "loginSheetController".
- "loginSheetController" contains an NSMutableArray called "services". This is an array of MSMutableDictionaries. The dictionaries each contain two keys, "service" and "name". "service" is the key for the actual NSNetService object discovered using NSNetServiceBrowser. "name" is the key for the name of the NSNetService.
- The window contains an NSArrayController named "Array Controller". Its content array is bound to "File's Owner" with a Model Key Path of "services". All boxes underneath are unchecked.
- The object controller is set to mode "class", class name "NSMutableDictionary", the checkbox for "Prepares Content" is checked, the box "Editable" is checked, and I have added a key called "name".
- The NSTableViewColumn's Value is bound to "Array Controller", the controller key is "arrangedObjects", and the model key path is "name". All other boxes are unchecked.
Whenever I attempt to run this program, I get the following error:
Code:
[<NSCFArray 0x10055c480> addObserver:forKeyPath:options:context:] is not supported. Key path: name
I don't understand why it is giving me this error because I am not asking for a key path of an array, I am asking for the key path of a dictionary. What am I doing wrong? I've read the Apple KVC guide, the Apple Bindings guide, I've searched this forum, cocoa-dev, cocoadevcentral, cocoadev, Cocoa is my Girlfriend, and Stack Overflow, and I still cannot find my answer. I know I must be missing something simple that I just am not seeing.