Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Now that you have taught your object to encode and decode itself, you will use it to add saving and loading to your application. When it is time to save your people to a file, your MyDocument class will be asked to create an instance of NSData. Once your object has created and returned an NSData object, it will be automatically written to a file.
To create an NSData object, you will use the NSKeyedArchiver class. NSKeyedArchiver has the following class method: