Program state saving and recovery

Source: Internet
Author: User

Enable save and restore to add the following two methods to the application delegate of the AppDelegate. m file:
RestorationldentifierUIKite does not automatically store all information about the application status. You need to tell UIKit which view controllers you need to participate in. You need to assign a Restoration Identifier to these view controllers in the storyboard. Any content with a Restoration ID will be protected and restored. So far, the system can only help you restore to a specific view controller, and then regenerate the objects in the Controller to let the system know which objects you need to save. You need to implement two methods. 
 

When you press the home Key in the program, you will call encodeRestorableStateWithCoder: to save the object you want to save. The next time you open the program, you will call decodeRestorableStateWithCoder: to restore the previously saved objects.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.