Note that there are some explanatory texts on larger screens.

plurals
  1. POAccumulate results from separate web requests
    text
    copied!<p>I'm fairly new to both multi-threading and iOS, and I've hit a mental roadblock on how I might approach this problem. I don't need a ton of code or expect you to write it for me, rather I'm just looking more for the conceptual approach, or perhaps brief pseudocode.</p> <p>I have an app on iPad.</p> <p>I have 8 files used by the app stored on Azure (Cloud storage)</p> <p>The user's can download these 8 files at their whim for use locally on the iPad.</p> <p>Every 30 min, I check the 8 files on Azure and compare them against the files stored locally for differences. Each changed file on Azure (call it a hash compare of azure file vs. local file for simplicity) counts as "+1" when counting up the changed files between whats on the iPad vs. whats on Azure.</p> <p>The problem I'm having is, the way Azure stores files, it is necessary for me to make 2 asynch web requests from the iPad, getting 3 of the 8 files in the first call, and 5 of the 8 files in the second call. </p> <p>Well, I need to be able to compare all 8 at once in order to be able to update the badge properly with the correct count of how many files have changed. If I just process the first web call (and say 1 file has changed), then I update the badge with a 1, and a few seconds later the second web request's response comes in, and 3 files have changed, and I update the badge with 3, well, that's incorrect, because it should be 4. The 1 change from the first web request's response, + the 3 changes from the second web request's response.</p> <p>So what's the best/simplest way to accumulate the results from these 2 web request responses so that I can do a single comparison of all 8 files at once and update the badge with the proper count.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload