开发者

Can NSUserDefaults store multiple different data types?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜