O'Reilly logo

Beginning iOS 5 Application Development by Wei-Meng Lee

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CREATING APPLICATION PREFERENCES

Creating application preferences for your iOS application is a relatively straightforward process. It involves adding a resource called the Settings Bundle to your project, configuring a property list file, and then deploying your application. When your application is deployed, the application preferences are automatically created for you in the Settings application.

The following Try It Out shows how to add application preferences to your iPhone application project in Xcode.

TRY IT OUT: Adding Application Preferences

  1. Using Xcode, create a new Single View Application (iPhone) project and name it ApplicationSettings. You will also use the project name as the Class Prefix. Ensure that you have unchecked the Use Automatic Reference Counting option.
  2. Right-click the project name in Xcode and add a new file. Click the Resource template category and select Settings Bundle (see Figure 9-2). Click Next.

    image

    FIGURE 9-2

  3. When asked to name the file, use the default name of Settings.bundle and click Save.
  4. The Settings.bundle item should now be part of your project (see Figure 9-3). Expand it and click the Root.plist item to view its content using the default Property List editor (see Figure 9-4).
  5. Press Command-R to test the application on the iPhone Simulator. When the application is loaded on the Simulator, press the Home key to return to the main screen of the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required