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
在交換的過程中咏闪,不要去保存與恢復(fù)vc——does not restore the full state of the object.
保存vc時奥溺,對vc進(jìn)行編碼好港;恢復(fù)vc時愉镰,對vc進(jìn)行解碼