I am writing an app for the iPhone that needs to store integers so that when the user opens the app, it will be able to retrieve the integers stored from the last session and when the program has ended, it will store the integers. The problem that I am having is that there is a problem with storing primitive data types such as integers.
Share
For small amounts of data you can use NSUserDefaults which has methods to save primitive types such as:
Otherwise convert them to
NSNumbertypes and save as objects, perhaps in a plist.If you have a substantial amount of data consider CoreData.
Example:
NSLog output: