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?

Answers


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. :)


Need Your Help

Sending multiple Ajax queries in sequence fails in chrome and Safari

javascript jquery ajax google-chrome safari

I have an issue were I display a sequence of dialogue or AJAX results that feed from each other. For example. A user will click to send a message that fires an ajax call, a dialogue opens, user fil...

Hide HTML with PHP conditional - Not working

php html conditional-statements

I am very new to PHP and I am trying to get a piece of PHP code to run inside of my HTML file.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.