How often are NSUserDefaults synchronised?

大兔子大兔子 提交于 2019-12-23 10:26:23

问题


The documentation for NSUserDefaults says that the synchronise method is called periodically but does not mention how frequently. 10 minutes of Google searches did not reveal anything.

How frequently is the synchronise method called?


回答1:


This is an implementation detail which is not disclosed (probably it isn't even a constant time interval). However, you can find it out yourself by performing a method swizzling on - [NSUserDefaults synchronize] and changing its implementation so that it calls NSLog() every time it's synchronized.



来源:https://stackoverflow.com/questions/14031901/how-often-are-nsuserdefaults-synchronised

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!