Trouble is using this….
tell theArrayController to set tempRow1 to (santasAlarmClockTable's clickedRow()) as integer
tell theArrayController to set tempColumn to (santasAlarmClockTable's clickedColumn()) as integer
set storeEditRow to tempRow1
my loadTheFieldsandButtons()
on loadTheFieldsandButtons()
set tempRow to storeEditRow
try
set theNSDate to (my theData's objectAtIndex_(tempRow)'s valueForKey_("theStartDateColumn"))
theStartDate's setDateValue_(theNSDate)
set theASDate to NSDateToASDate_(theNSDate)
set thetemphours to (hours of theASDate)
set thetempAMPM to "AM"
if thetemphours = 12 then set thetempAMPM to "PM"
if thetemphours = 0 then
set thetemphours to 12
end if
if thetemphours > 12 then
set thetemphours to thetemphours - 12
set thetempAMPM to "PM"
end if
theHours's setstringValue_(thetemphours)
theminutes's setstringValue_(minutes of theASDate)
set theAMPM's title to theTempAMPM
on error errmsg
display dialog errmsg
end try
--etc, etc,etc
end loadTheFieldsandButtons_
where the actual selected row is the third row, C, returns the values of E for tempRow in loadTheFieldsandButtons.
Then, using…
tell theArrayController to removeObjectAtArrangedObjectIndex_(storeEditRow)
tell theArrayController to insertObject_atArrangedObjectIndex_(anEntry, storeEditRow)
replaces row 3 which is now C, with the contents of E
How do i get the code to actually get row 3 in a sorted column, not row 5?
Obviously the code…
set theNSDate to (my theData's objectAtIndex_(tempRow)'s valueForKey_("theStartDateColumn"))
is the problem, as it's getting the index 3 indexed values. But i want the actual rows values, which is index 5