Hi All,
I have a delegate method for a table view. If I add an array to the array controller for it, rather than a single entry, the method returns either a negative number or a large number sometimes. I am trying to find a way to trap this or check the number (> 0) so the method doesn’t crash. How do I coerce the selectedRow or selectionIndex so I can use it?
on tableViewSelectionDidChange_(Notification)
set thistableview to notification's object()
set indexnum to thistableview's selectedRow() --(this can produce negative numbers)
--or....
set indexnum to Backset's selectionIndex() --(this can produce crazy high numbers)
set indexnum to indexnum as integer (or number etc..) (this doesn't throw and error)
if indexnum < 0 (this throws an exception which can't be caught and crashes)
--etc etc...
end tableViewSelectionDidChange_()
Thanks, Rob