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:
read data

and..
save data

Advertisement


No Responses Yet to “Save settings”

  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.