开发者

Can NSUserDefaults store multiple different data types?

开发者 https://www.devze.com 2023-03-28 08:28 出处:网络
Such as both a boolean 开发者_JAVA百科and an integer? Thanks for your help!Yes.NSUserDefaults simply operates like an NSDictionary, but with a few more convenience methods.

Such as both a boolean 开发者_JAVA百科and an integer? Thanks for your help!


Yes. NSUserDefaults simply operates like an NSDictionary, but with a few more convenience methods.

Don't forget to synchronize the data you set after you're done.


Sure! Here are the setter functions for NSUserDefaults:

– setBool:forKey:
– setFloat:forKey:
– setInteger:forKey:
– setObject:forKey:
– setDouble:forKey:
– setURL:forKey:
0

精彩评论

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