Delete data when app is killed in the background.

前端 未结 3 680
误落风尘
误落风尘 2021-01-28 11:55

I have an app where I am saving data but when the app is killed in the background I have to delete all the saved data.

I tried using this method:

- (void         


        
3条回答
  •  不思量自难忘°
    2021-01-28 12:54

    applicationWillTerminate: is basically never called and you should no longer rely on it.

    The app is not given any callback when it is killed so you can't do anything. You need to decide on a different approach based on the actual user requirement. This may involve encryption / not holding certain data on disk (only ever in memory) / etc...

提交回复
热议问题