开发者

Data persistence through NSUserDefaults

Is data persisted in NSUserDefaults between app launches? I want some small data to be 开发者_开发问答persisted even if I quit and relaunch the app.


Yes.

Data will persist in NSUserDefaults for the entire lifetime of the app.


Data will persist. But, NSUserDefaults is used primarily for preferences. Users expect that it is okay to delete the preference file without affecting their documents and created data.

If the data is not a preference, you may want to store the data in a file inside ~/Library/Application Support/[your application's name]/ instead.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜