Re: dynamically adding NSTableColumns while using bindings
Re: dynamically adding NSTableColumns while using bindings
- Subject: Re: dynamically adding NSTableColumns while using bindings
- From: "I. Savant" <email@hidden>
- Date: Wed, 1 Aug 2007 18:34:21 -0400
On Aug 1, 2007, at 5:11 PM, Paul Gribble wrote:
I have one NSArrayController in my nib file called dataController.
In IB I
have added one key to dataController list of keys, called "col1". the
dataController is then bound (by pointing and clicking in IB) to my
myDocument instance variable "data".
Ah, much easier. :-)
1. create a new NSTableColumn and add it to the NSTableView. (I can
do this,
no prob).
Yes. Easy enough.
*2. create a new key for dataController called col2 (how do I do this
programmatically?)
Completely unnecessary. I never implicitly add keys to controllers
myself. Maybe someone can tell me why I'm wrong in not doing so, but
it's never hurt me before.
You may enjoy the following (imprecise) phrase: "If you bind it,
it will find it.*"
* Unless it doesn't exist or is not KVC/KVO-compliant, then it
will probably bitch at you.
3. programmatically bind the new NSTableColumn to the
dataController new key
"col2" (I know how to do this from looking at mmalc's example
binding code)
Also easy (when you know how).
Am I on the right track?
Why not try it and tell *us*? ;-)
--
I.S.
_______________________________________________
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