I am working on an app representing JSON from web API.
The remote source updates several times a day.
All I want to do is:
// pseudo code makeRequest() { if (network not available){ if (cache not exists) { showEmptyScreen() }else if (cache exists){ useCache() } }else if (network available){ if (cache not exists) { loadFromRemote() }else if (cache exists){ if (cache is older than latest update) { loadFromrRemote() }else { useCache() } } } } I've read about NSURLCache from Apple and from NSHipster.
It's still confusing that if NSURLCache could do what I want. For instance, how does it work to check if there's a newer version of data without really download anything?
And if NSURLCache could not handle the checking, how could I code it myself?
Thanks for any advice!