Is it mandatory to call NSUserDefaults synchronize method?

前端 未结 4 617
天命终不由人
天命终不由人 2020-12-16 14:36

Please, anyone, help me: Is calling NSUserDefaults\'s synchronize() method mandatory?. If I don\'t call it, what will happen? My application is wor

4条回答
  •  时光取名叫无心
    2020-12-16 14:54

    Normally it works perfectly fine and you only have to use it in special cases, for example when the app will close directly after writing to NSUserDefaults. So you can simply add the synchronize method to the corresponding AppDelegate-method.

提交回复
热议问题