What is the correct way to save NSUserDefaults when my app is terminated on iOS

后端 未结 4 917
不知归路
不知归路 2021-02-10 03:16

I need to save my NSUserDefault when my app is completely quit in iOS. not didenterbackground and foreground. Only when user kill my app w

4条回答
  •  遇见更好的自我
    2021-02-10 03:40

    You can set your Application does not run in background" = "YES" in your info.plist file and you can see applicationWillTerminate delegate getting called & storing values in NSUserDefaults.

    enter image description here

提交回复
热议问题