Re: How to get selected Item in a NSTableVIew
Re: How to get selected Item in a NSTableVIew
- Subject: Re: How to get selected Item in a NSTableVIew
- From: "I. Savant" <email@hidden>
- Date: Tue, 24 Mar 2009 16:31:30 -0400
On Tue, Mar 24, 2009 at 9:59 AM, Sourabh Sahu
<email@hidden> wrote:
> I have created a NStableView and populated a data onto it.
How? NSTableDataSource protocol or via Bindings? That's important.
> Now I want user can only click on a cell and when it clicked on cell,the value of that cell
> get displayed onto some NSTextField.
If via NSTableDataSource, you don't have the benefit of an array
controller keeping track of selection, so you'll want to use
NSTableView's delegate methods (look in the NSTableView Class
Reference). There're a few dealing with selection. Implement the
desired method(s) and respond to them accordingly (such as by updating
your text field).
If via Bindings, you'd just bind the field's value to your table's
array controller's selection.desiredKeyPath (where "desiredKeyPath" is
the property of the selected row's corresponding object you wish to
display).
> DISCLAIMER
> ==========
> This e-mail may contain privileged and confidential information which is the property of
> Persistent Systems Ltd. ...
Wow. Probably shouldn't have posted it to a public mailing list then, huh? ;-)
--
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