 |
 |
TableView: stringValue of an item???
|
 |
|
 |
|
Senior User
Join Date: Jun 2002
Location: UK
Status:
Offline
|
|
OK, I have a TABLE and I can select row. Fine.
But what I need is to get the stringValue of the item in the a given COLUMN of the selected row.
What should I do?
Get an array and turn it into a string? or something?
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status:
Offline
|
|
Well, you already know how your table view is displying text - that's because you implemented tableView:objectValueForTableColumn:row: in your delegate, right? Then you can just send this message to your delegate with the appropriate tableView instance, tableColumn instance, and row index (found by calling NSTableView's selectedRow method, although it's slightly more involved if more than one row can be selected), and it will return the object value. That is, what you see is what you get.
There's other ways - I usually write a custom method that does virtually the same thing as tableView:objectValue..., but it only accepts a couple parameters, like the tableView, the column identifier, and the row index.
Does that make sense?
Matt Fahrenbacher
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Jun 2002
Location: UK
Status:
Offline
|
|
Originally posted by Ghoser777:
Well, you already know how your table view is displying text - that's because you implemented tableView:objectValueForTableColumn:row: in your delegate, right? Then you can just send this message to your delegate with the appropriate tableView instance, tableColumn instance, and row index (found by calling NSTableView's selectedRow method, although it's slightly more involved if more than one row can be selected), and it will return the object value. That is, what you see is what you get.
There's other ways - I usually write a custom method that does virtually the same thing as tableView:objectValue..., but it only accepts a couple parameters, like the tableView, the column identifier, and the row index.
Does that make sense?
Matt Fahrenbacher
Hmmm... it almost(*) makes sense. Let me try it out.
I've never completely understood what the heck is the "objectValueForTableColumn"?? Is it the column's identifier? Or..?
(*) It's veeeeeeeery late where I am so this makes it harder for me 
(Last edited by VEGAN; Sep 2, 2002 at 07:15 PM.
)
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Jun 2002
Location: UK
Status:
Offline
|
|
THANX I GOT IT 
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|