1. using NSUserDefaults.
2. using NSKeyedArchiver.
Both are very standard methods provided by Cocoa, but as NSUserDefaults is designed for storing default settings rather than data inside the app, in most of the cases, you want to use NSKeyedArchiver instead.
To use NSKeyedArchiver, first of all you need to add a protocol called NSCoding to the class whose properties are supposed to be saved and then loaded in the app.
For example, you have a class called Student which is used to store some information about a student. Its header may look like this:
Now we are on the halfway. What we need to do then is to tell the app that we want to save some data before it is terminated. Find the applicationWillTerminate: method in YourProjectAppDelegate.m file, and add the following code:
The object student is an instance of Class Student. In this example, we save it in a file named data under the the Documents folder.
Alright, now we should be able to save our data into the disk. Now the only thing left is to load the data. The method may look like this:
You can call this method whenever you believe is necessary to load the data from local disk to your app.
Happy Coding :)