• 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
Re: How to get selected Item in a NSTableVIew
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >How to get selected Item in a NSTableVIew (From: Sourabh Sahu <email@hidden>)

  • Prev by Date: Noob question: Weirdness getting the bounds of an NSView...
  • Next by Date: Control over position of tooltip for a NSView
  • Previous by thread: How to get selected Item in a NSTableVIew
  • Next by thread: Noob question: Weirdness getting the bounds of an NSView...
  • Index(es):
    • Date
    • Thread