iOSTable force a cell to redraw

Couldn’t find anything in the search, but when I update an iOSTableCellData.text value, it won’t redraw on the screen until the cell is dragged out of and back into view. I’ve tried using iOSTable.invalidate but that does nothing.

I’m trying to make a table with cells that will update every second so reloading isn’t an option.

Couldn’t find anything in the declares but I assume there’s some way to do this. Thanks!

Remove+addrow or insert forces the table to update.

That doesn’t update any of the individual existing cells, and adding/removing a row every second causes the table to stop functioning basically.

http://stackoverflow.com/questions/5418655/how-to-reload-and-animate-just-one-uitableview-cell-row
Definitely possible with declares. I can put together an extends function in an hour or two when I am back at my computer.

Thanks Jason. That’s exactly what I was looking for, just didn’t know if it was in any of the declares yet.

Ok, try this:

[code]Sub ReloadRow(extends table as iOSTable, row as Integer, inSection as Integer)
const UITableViewRowAnimationNone = 5

const FoundationLib = “Foundation.framework” //remove these and NSClassFromString if using iOSKit
const UIKitLib = “UIKit.framework”
declare function NSClassFromString lib FoundationLib (clsRef as CFStringRef) as ptr

declare function arrayWithObject lib FoundationLib selector “arrayWithObject:” (clsRef as ptr, obj as ptr) as ptr
declare function indexPathForRowInSection lib FoundationLib selector “indexPathForRow:inSection:” _
(clsRef as ptr, row as Integer, section as Integer) as ptr
declare sub reload lib UIKitLib selector “reloadRowsAtIndexPaths:withRowAnimation:” _
(obj_id as ptr, indexPath as ptr, animation as Integer)

dim idxPath as Ptr = indexPathForRowInSection(NSClassFromString(“NSIndexPath”), row, inSection)
dim idxPathArr as ptr = arrayWithObject(NSClassFromString(“NSArray”), idxPath)
reload(table.Handle, idxPathArr, UITableViewRowAnimationNone)
End Sub
[/code]

iosTable.reloadRow