Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/qwzybug/JSUserDefaults
JS bridge for accessing NSUserDefaults from a UIWebView
https://github.com/qwzybug/JSUserDefaults
Last synced: 3 months ago
JSON representation
JS bridge for accessing NSUserDefaults from a UIWebView
- Host: GitHub
- URL: https://github.com/qwzybug/JSUserDefaults
- Owner: qwzybug
- Created: 2010-11-04T20:13:05.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2010-11-10T22:39:12.000Z (about 14 years ago)
- Last Synced: 2024-10-28T14:06:59.287Z (3 months ago)
- Language: Objective-C
- Homepage:
- Size: 125 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome - JSUserDefaults - JS bridge for accessing NSUserDefaults from a UIWebView (etc)
- awesome - JSUserDefaults - JS bridge for accessing NSUserDefaults from a UIWebView (etc)
README
# JSUserDefaults
Real simple drop-in replacement for UIWebView. Just change the class membership of the web view in your nib (or create it programmatically, that oughta work too) and it'll let you access NSUserDefaults through the JSUserDefaults object. Like this:
[[NSUserDefaults standardUserDefaults] setObject:@"Bar"
forKey:@"Foo"];(...some time later...)
document.write(JSUserDefaults.objectForKey("Foo"));
You can also set objects. Any plist object should work fine—arrays, dictionaries, strings, numbers. Other things might be dicey.
See the Demo project for an example.