By Rupert
iPhone Note #10: Creating Custom Settings

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.

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"];
| Print article | This entry was posted by rupert on September 4, 2009 at 4:47 am, and is filed under iphone. Follow any responses to this post through RSS 2.0. You can skip to the end and leave a response. Pinging is currently not allowed. |


