开发者

How to erase an object saved with NSUserDefaults from disk

开发者 https://www.devze.com 2023-01-16 22:53 出处:网络
Let\'s say I saved data to disk like this: [[NSUserDefaults standardUserDefaults] setObject:[N开发者_如何学编程SKeyedArchiver archivedDataWithRootObject:theArray] forKey:@\"savedArray\"];

Let's say I saved data to disk like this:

[[NSUserDefaults standardUserDefaults] setObject:[N开发者_如何学编程SKeyedArchiver archivedDataWithRootObject:theArray] forKey:@"savedArray"];

How can I erase that from disk?


Try this.

[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"savedArray"];
0

精彩评论

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