iPhone Note #10: Creating Custom Settings
-
Create a directory on your desktop, name it “Foo”
-
Download this Sample_plist.txt and place it inside foo. Name it as Root.plist
Foo/ Foo/Root.plist |
- Rename Foo to Settings.bundle
Settings.bundle/ Settings.bundle/Root.plist |
- Drag it to your project.
- 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"]; |