Home > iphone > iPhone Note #10: Creating Custom Settings

iPhone Note #10: Creating Custom Settings

September 4th, 2009 rupert Leave a comment Go to comments

settings-overview.gif

1. Create a directory on your desktop, name it “Foo”

2. Download this Sample_plist.txt and place it inside foo. Name it as Root.plist

Foo/
Foo/Root.plist

3. Rename Foo to Settings.bundle

Settings.bundle/
Settings.bundle/Root.plist

4. Drag it to your project.

settings-bundle.gif

5. To retrieve a value from the settings.. For example, if we want to retrieve if the “enabled” switch is on or off?

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
BOOL b = [defaults boolForKey:@"enabled_preference"];
Categories: iphone Tags:
  1. No comments yet.
You must be logged in to post a comment.