iOS6+ offline management working like the native cache management
I am trying to add offline usage to an app. I simply need all the work done by NSURLRequest / NSURLCache, while being able to choose exactly the disk storage location, so I can put it in "/Library/Application Support/whatever" where it won't ever be deleted (without forgetting the flag so it's not synced on iCloud / iTunes).
I feel like I have to do all the work myself and I run in a first issue. NSURLCache is keeping in memory a dictionary where the keys are the NSURLRequest and the values are the associated NSCachedURLResponse. I'm doing the same but then, I can't write this dictionary on the disk as it isn't made of basic types.
Do you have an idea on how to write on disk such a dictionary?
I am in a similar situation, I need a cache that can be used when the app is offline or untile the app parses new data.
AFAIK everyone would recommend you: https://github.com/steipete/SDURLCache.
But theoretically in iOS6 the NSURLConnection writes the cache to disk and you can use that cache as offline cache, but I still have to found out how.
So partial answer, will try to find out more and update the answer. :)