• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Simple Array of Strings Binding Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Simple Array of Strings Binding Question


  • Subject: Simple Array of Strings Binding Question
  • From: Seth Willits <email@hidden>
  • Date: Sat, 30 Aug 2008 18:44:37 -0700

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Simple Array of Strings Binding Question
      • From: Chris Hanson <email@hidden>
  • Prev by Date: Re: NSTableView "sometimes" doesn't repaint on reloadData:?
  • Next by Date: CoreData and mutableArrayValueForKey:
  • Previous by thread: Re: (Newbie) How do Multiple NSWindowControllers find MyDocument?
  • Next by thread: Re: Simple Array of Strings Binding Question
  • Index(es):
    • Date
    • Thread