[英]Can NSUserDefaults store multiple different data types?
Such as both a boolean and an integer?比如一个 boolean 和一个 integer? Thanks for your help!
谢谢你的帮助!
Yes.是的。 NSUserDefaults simply operates like an NSDictionary, but with a few more convenience methods .
NSUserDefaults 就像 NSDictionary 一样简单地运行, 但有一些更方便的方法。
Don't forget to synchronize the data you set after you're done.完成后不要忘记同步您设置的数据。
Sure!当然! Here are the setter functions for
NSUserDefaults
:以下是
NSUserDefaults
的 setter 函数:
– setBool:forKey:
– setFloat:forKey:
– setInteger:forKey:
– setObject:forKey:
– setDouble:forKey:
– setURL:forKey:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.