Re: Figuring out which values are selected in an NSTableView
Re: Figuring out which values are selected in an NSTableView
- Subject: Re: Figuring out which values are selected in an NSTableView
- From: mmalcolm crawford <email@hidden>
- Date: Tue, 17 May 2005 22:50:38 -0700
On May 17, 2005, at 10:16 PM, Denis Stanton wrote:
I think you're an inch away from telling me the answer. In fact
I'm sure you are telling me the answer, but you're assuming a
little more understanding on my part.
*If* I understand your situation properly, I think you're
overestimating the complexity of the problem...
I think the problem is that paymentController is not connected or
bound properly. I just don't know exactly what object to select,
what binding to select and what value to enter.
My MyDocumentNib contains icons for File's owner and NSArrayController
My Window contains an NSTableView with columns.
Can you give this me in really simple terms? I don't know the
exact requirement for paymentController outlet to be connected.
Which thing do I select, which binding, and which parameters for
that binding?
*If* all that you want is, in MyDocument, to be able to determine
which objects are selected in the table view, then:
You need a regular outlet from MyDocument (File's Owner) to the
NSArrayController:
IBOutlet NSArrayController *paymentController;
In IB, connect paymentController to the array controller, just as you
would any other outlet to any other object in the nib.
When you need to know what objects are selected in the table view,
simply send paymentController the selectedObjects message:
NSArray *array = [paymentController selectedObjects];
I trust that's all that's required?
The one thing that I'm not sure about is why you're implementing -
(void)observeValueForKeyPath: (NSString *)keyPath ofObject: (id)
object change: (NSDictionary *)change context: (void *)context?
There may well be a valid reason for it, but given the current
context it does raise a question mark...
mmalc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden