NSTableView of strings

Christiaan Hofman cmhofman at gmail.com
Sat Dec 8 17:00:18 PST 2007


It's exctly as you say: you cant use a NS(Mutable)String for mutable  
value binding. You have to wrap it in an object such as  
NSMutableDictionary. (Well you can define a -string accessor in an  
NSString category, but I wouldn't recommend it).

Christiaan

On 9 Dec 2007, at 1:51 AM, David Dunham wrote:

> I'm trying to set up a list of strings, which the user can edit in  
> an NSTableView. I can bind it to an NSArray which contains  
> NSMutableStrings. This displays the list fine, but when I try to  
> edit one of the strings, it fails. There doesn't seem to be a key  
> that works to both read and write the value of an NSMutableString.  
> There's a setString: but no string, for example. (Displaying works  
> fine with no key at all.)
>
> I'm no Cocoa bindings guru, so I'm probably missing something.
>
> (The same window has a multi-column NSTableView which is bound to a  
> more complex data structure. This works fine, because my data has  
> setters and getters for each column.)
>
> David Dunham     A Sharp, LLC
> Voice/Fax: 206 783 7404     http://a-sharp.com
> "People seem to misinterpret complexity as sophistication" --  
> Niklaus Wirth
>


More information about the MacOSX-dev mailing list