Add keys programatically to NSArrayController?
Add keys programatically to NSArrayController?
- Subject: Add keys programatically to NSArrayController?
- From: Rick Hoge <email@hidden>
- Date: Sat, 31 Jul 2004 07:23:54 -0400
Is there any way, using Objective-C calls, to add new keys to an
existing instance of NSArrayController?
I have an NSTableView in which I'd like to be able to allow the user to
add an arbitrary number of columns whose value would be bound to keys
in a custom class. My plan was to generate new keys automatically
(e.g. @"key1",@" key2", ...) and have my custom class provide
appropriate values by parsing these keys in valueForKey: . The
arbitrary number of columns would correspond to an aribitrary number of
object attributes in the custom class
For this scheme to work, I need to be able to add @"key1" to the
NSArrayController I'm using to serve my list of objects to the table
when a column is added. Such functionality does not seem to be
included in the docs for NSObjectController and NSArrayController -
anyone know if it is possible?
Obviously my 'arbitrary number of object attributes' would be best
modeled as an NSArray instance variable in the custom class. I don'
know how you would associate specific elements in the array with the
appropriate columns through bindings though. I'm already using
bindings in this table and, as this has been working well for me (up to
this), would like to stick to this approach if possible.
Thanks for any suggestions,
Rick
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.