Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Simple Array of Strings Binding Question



Howdy,


I have an array of strings which I am displaying in a table view. I have an array controller whose contentArray is bound to an array at a key path through File's Owner. I then bind the table column value to arrangedObjects. I have Add and Remove buttons with Enable respectively bound to canAdd and canRemove, and have them hooked up to appropriate actions. That's all lovely.


Remove works, Add works, but if you change a string's value by editing the table cell, it throws an exception:

Error setting value for key path of object (from bound object <NSTableColumn: 0x16497030>(null)): [<NSCFString 0xa007b328> setValue:forUndefinedKey:]: this class is not key value coding- compliant for the key .


More or less expected in hindsight. There's no value of the string to set, instead I want to replace the string object in the array. So... what do I do? Do I really need to make up a model object to contain the string, just to use bindings here? There's absolutely _no_ other data I need to associate with the string, so it'd really be pointless otherwise.



Thanks,

--
Seth Willits




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.