I’ve just started working with ASOC (isn’t that a character in Dilbert??)
and I’m probably being dumb, but I don’t seem to be able to set a
list to the text that’s been entered in an NSScrollView.
tia
rhb
You can’t enter text in an NSScrollView – it’s usually a container for other views, like NSTableViews and NSTextViews. Can you expand on what you’re trying to do?
Sorry Shane I was atravellin’ for a while
Yes, I have a TableView of Text Cells.
I’m trying to get the values of all the cells into a list for further processing, and I seem to be missing something.
TableViews don’t have cells, they have NSTableColumns. Look in the MainMenu.xib window in Interface Builder with it set to list view, to see the hierarchy of objects.
I’m afraid I still don’t understand your question – can you be more specific?
Shane
The hierarchy is :
Scroll view
Table View (Keyword)
Table column (theKeyword)
Text field cell (Text Cell)
There’s just one column.
I’ve been playing about with stuff like
on setKeywords_(sender)
repeat with i from 0 to ((numberOfRowsInTableView_(aTableView) as integer) - 1)
set thisKeyword to {theDataSource’s objectAtIndex_(i)}
set theValue to thisKeyword’s |properties|'s valueForKey_(“theKeyword”)
…
end repeat
end setKeywords_
and I can’t get the properties.
I’ve tried things like:
set mySelectedObject to aTableView’s selectedObjects()
and
set theItem to tableView_(aTableView)'s objectValueForTableColumn_(Keyword)'s row_(i)
and
set theItem to thisKeyword’s stringValue --(valueForKey_(“theKeyword”))
but I’m obviously missing something obvious
thnks
rhb
I’m afraid I’m none the wiser on what you’re trying to do.
You have a table – how are you populating it?
From a text field bound to my App Delegate (w. key theKeyword)
on addData_(sender)
tell keywordField to selectText_(me)
set newData to {theKeyword:theKeyword}
theDataSource’s addObject_(newData)
aTableView’s reloadData()
my clearFields()
aWindow’s makeFirstResponder_(keywordField)
my writeToFile()
end addData_
I also delete from the table.
I’m trying to get a list out of this that I’ll use to do some EXIF editing.
If you’re using a datasource for the table, it will hold the data you want.