IOS: store an array with NSUserDefault

前端 未结 6 1009
南旧
南旧 2021-02-06 05:58

I want to store an array with NSUserDefault, then, I put in applicationDidEnterBackground

[[NSUserDefaults standardUserDefaults] setObj         


        
6条回答
  •  天命终不由人
    2021-02-06 06:32

    Do not forget to sync the buffer before going into background:

    [[NSUserDefaults standardUserDefaults] synchronize];
    

提交回复
热议问题