I have an which subscribes to an external event, when it receives data it adds it to the table view data source. im trying to refresh the screen when new data is added to the table.
I have tried below 2 approaches to update table in UI and both of them doesnt show latest data on the screen unless i click on the screen somewhere.
public void updateTable(){
try {
if (tableView() != null) {
NSIndexPath path = NSIndexPath.indexPathForRowInSection(tableDataSource.getListSize() - 1, 0);
NSArray paths = NSArray.arrayWithObject(path);
tableView().insertRowsAtIndexPathsWithRowAnimation(paths, UITableViewRowAnimation
.Automatic);
}
} catch (Exception e) {
e.printStackTrace();
}
}
Above method was taken from the RSS feed MOE sample
I have also tried to refresh the whole table with
//below code does not refresh the screen unless i click on in
this.tableView().reloadData();
I’m looking for a working method/code snippet to update my tableview when i add data to it.
Thank you in advance
Sachin