Saving and Restoring Your View Controllers

Saving and Restoring Your View Controllers

这两种过程都是自动的,但是你必须明确需要保留的部分

For an overview of the preservation and restoration process, see App Programming Guide for iOS.

* (Required) Assign restoration identifiers to the view controllers whose configuration you want to preserve; see Tagging View Controllers for Preservation.

* (Required) Tell iOS how to create or locate new view controller objects at launch time; see Restoring View Controllers at Launch Time.

* (Optional) For each view controller, store any specific configuration data needed to return that view controller to its original configuration; see Encoding and Decoding Your View Controller’s State.

Tagging View Controllers for Preservation

Each view controller has a restorationIdentifier property----->

1--Choosing Effective Restoration Identifiers

2--Excluding Groups of View Controllers

3--Preserving a View Controller’s Views

Restoring View Controllers at Launch Time

Encoding and Decoding Your View Controller’s State

Tips for Saving and Restoring Your View Controllers

在交换的过程中,不要去保存与恢复vc——does not restore the full state of the object.

保存vc时,对vc进行编码;恢复vc时,对vc进行解码

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 最近部门考核,考核内容是写一个UML的编译脚本,虽然并不是很难,但他不布置这些东西我想我也不会去学,因为不知道很多...
    e666upho阅读 1,137评论 0 0
  • 所有的不安与忧虑真的会随着时间 空间的流逝 变化 慢慢褪去 直至遗忘 或者说是另一个不安忧虑的事慢慢滋生替代当前的不安吧
    justDOit_1050阅读 981评论 0 0
  • 错错错 恨把离别当酒歌 多多多 人生反复愁几何 说说说 谈不尽甘尽苦挫 做做做 做成别人空自我
    草芥人阅读 2,435评论 1 0
  • 数字朝夕,传递有温度的数字资讯 不知道大伙儿是否曾有过疑问,为什么苹果,高通,华为这么有钱,也都有自己自主产权的芯...
    科技家园阅读 3,544评论 0 0