When (not) to abuse NSUserDefaults

后端 未结 5 1771
予麋鹿
予麋鹿 2020-12-09 15:48

I wonder what the guidelines are for:
1 - how often I can read from NSUserDefaults
2 - how much data I can reasonably store in NSUserDefaults

Obviously, ther

5条回答
  •  没有蜡笔的小新
    2020-12-09 16:47

    Hundreds to thousands of items are fine in NSUserDefaults (it's basically just a wrapper around property list serialization). With respect to the overhead for your application, the best thing to do is try it and use a profiler.

提交回复
热议问题