Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

BNZ1

macrumors regular
Original poster
Nov 11, 2008
144
0
London
Hi Guys,

I have a tableView (inside a tab view) that pulls its data from an NSObject datacontroller file. The data contained in this is a list of locations, including the distance from the current location.

I am struggling to find the best way to automatically reload the table data on the event of a data update which is triggered whenever the phone recieves a location update.

Is there a standard way for my datacontroller file to trigger a table reload whenever its data is updated, or would I be better using a time based reload in the tableView (I prefer the concept of data triggered update, with the adjustment coming from setting a distance moved variable).

Thanks.
 

Taum

macrumors member
Jul 28, 2008
56
0
Hi,

You can use reloadData to reload the whole table, or more fine-grained methods like those found under "Inserting and Deleting Cells" and "Reloading the Table View" in the docs for UITableView.
 

BNZ1

macrumors regular
Original poster
Nov 11, 2008
144
0
London
Hi,

You can use reloadData to reload the whole table, or more fine-grained methods like those found under "Inserting and Deleting Cells" and "Reloading the Table View" in the docs for UITableView.

Thanks,

It is not the reloading of the data itself causing me the issue, it is the trigger to reload the data. I think I may need a protocol/delegate/notification from my Datasource that triggers every time it updates itself? Does this sound right?

I cant directly tell a tableView to reload from my datasource, so I need to tell the tableViewController that the data has changed, and then the tableViewController needs to know to trigger a reloadData with this information?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.