Save settings
17May09
I implemented a SettingsImporter class to read and write user settings from/in a file. There are not much data to save, just the value of the distance filter, its on/off switch, and a boolean to show if the program launches the first time to show a disclaimer view.
To store this data into a simple .dat file I used the NSKeyedArchiver (or NSKeyedUnarchiver to read), which makes it very easy to store variables and objects in an architecture-independent format. (Apple reference)
Here some screenshots of code for reading and saving variables:

Advertisement
Filed under: Uncategorized | Leave a Comment
Tags: iphone, locative drama, read from file, save to file, scratch

No Responses Yet to “Save settings”