cocoa touch - UITableView with processes Load Cached Data - Display Table - Load New Data - Refresh Table -


I have a tableview that is made up of a lot of data that I download, at the end it takes some time To display the table (one or two), I started to cache the data locally, now when the scene is displayed, it appears almost instantly - great.

The problem is that I want to go and get a clear set of data and then refresh the table view

1) The UI is blocked and the cached data is never displayed < / P>

2) I worry that overwriting the cache data is having "reload data" problems. It seems that if no table has been displayed, then you can not be trusted to investigate.

I am doing this;

  - (zero) updateInfo [Remove allAbjects] [ArrayOfItems]; [Self loaded item: cached usage]; [Reload item]; If (use cached) {NSLog (@ "Cached data displayed, now updated"); UseCached = No; [Self update info]; }}  

I am thinking that my whole point of view is wrong - what is the best practice but there is any idea for the problem 1 I believe this is a main thread issue However, the above code runs on the background and as far as I understand that the reloaded data is done on the main but it is not attracted. It does not help to emphasize it on the main either.

For problem 2 I think the line [self update information] is starting; Say something else that changes the items in my array but rather clear it.


Comments