Created
November 8, 2013 15:07
-
-
Save tomokr/7372317 to your computer and use it in GitHub Desktop.
NSUserdefaultsにNSMutablearrayを格納する/読み出す ref: http://qiita.com/tomokr/items/3ba8fe9997e3fb52a16f
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
| NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; | |
| NSMutableArray *array = [[NSMutableArray alloc] init]; | |
| NSData *data = [NSKeyedArchiver archivedDataWithRootObject:array]; | |
| [ud setObject:data forKey:@"array_key"]; |
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
| NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; | |
| NSData *data = [ud objectForKey:@"array_key"]; | |
| NSMutableArray *array = [NSKeyedUnarchiver unarchiveObjectWithData:data]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment