开发者

iPhone applicationDidEnterBackground: method to save user data and any state information

开发者 https://www.devze.com 2023-01-05 03:31 出处:网络
What is the best approach to save any application state information or user data information before application goes to b开发者_StackOverflow中文版ackground?

What is the best approach to save any application state information or user data information before application goes to b开发者_StackOverflow中文版ackground?

Say for example I have one application level variable called "Authorised". Where should I save this information so I can get it back if it is purged by memory management.

Regards,

Atif


Well that depends a bit how big and complex the data is you want to save. If it is just a small amount of data representing the state, I would have a look at NSUserDefaults.

Have a look at this question as well:How to show the same view when the app is reopened

0

精彩评论

暂无评论...
验证码 换一张
取 消