开发者

How do I load this array into memory

I saved an array using the following code:

NSData *data = [NSKeyedArchiver archivedDataWithRootObject:myArray];
[[NSUserDefaults standardUserDefaults] setObject:data forKey:@"myArray"];

What is the c开发者_StackOverflow中文版ode to load it back into memory?


Put this where you need to load it, should work. You'll get back an immutable NSData object.

NSData *data = [[NSUserDefaults standardUserDefaults] dataForKey:@"myArray"];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜