richtaur
richtaur

Reputation: 208

How to get localStorage to work in a WebView in Xcode?

I've got a WebView in a Max OSX Cocoa Application in Xcode. This WebView is attempting to use HTML5's localStorage to save some data. It's technically working as expected (the data is getting/setting fine while the application is running), it's just not persisting when the application is closed and then reopened.

Any ideas on how to get localStorage to persist as expected?

Upvotes: 2

Views: 7360

Answers (2)

godblessstrawberry
godblessstrawberry

Reputation: 5048

Nowadays it persists by default for me in webview of an iPhone app. Even after phone restart it works fine.

Upvotes: 0

Jeff Busby
Jeff Busby

Reputation: 2011

A while back we were working on implementing local storage in the webview of an iPhone app, and what we found is that it does not work. Although local storage will work on the iPhones regular browser. We ended up doing what we needed natively within the app itself.

Looks like these guys came to the same conclusion:

How do I enable Local Storage in my WebKit-based application?

Caveat lecture: When we were trying this solution it was before iPhone 4 was released.

Upvotes: 2

Related Questions