Created
May 30, 2013 04:56
-
-
Save aaronpearce/5675804 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// loading | |
NSString *jsonString = [SSKeychain passwordForService:@"info" account:@"info"]; | |
if(jsonString) | |
[array addEntriesFromDictionary:[NSJSONSerialization JSONObjectWithData:[jsonString dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingMutableContainers error:nil]]; | |
// saving | |
NSString *jsonString = [[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:array options:NSJSONWritingPrettyPrinted error:nil] encoding:NSUTF8StringEncoding]; | |
[SSKeychain setPassword:jsonString forService:@"info" account:@"info"]; | |
---- | |
Anything you can convert to a string you can save. In the above I saved an array into a JSON string which I stored. | |
give me an example of what you are saving and I'll make an example |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment