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

TECHNIQUE 1 — MODIFYING THE DEVICE TARGET SETTING

The easiest way to ensure that your iPhone application runs as an iPad application (that is, full screen) is to modify the Targeted Device Family setting in your Xcode project. The following Try It Out shows you how to achieve this.

TRY IT OUT: Modifying the Device Target Setting

image

  1. Using Xcode, create a new Single View Application (iPhone) project and name it MyiPhoneApp. (You will also use the project name as the Class Prefix.) Ensure that you have the Use Automatic Reference Counting option unchecked.
  2. Select the MyiPhoneAppViewController.xib file to edit it in Interface Builder.
  3. Populate the View window with the following views (see Figure 5-1):
    • Label (set it to display “Please enter your name”)
    • Text field
    • Round Rect button (set it to display “OK”)

    image

    FIGURE 5-1

  4. Back in Xcode, press Command-R to test the application on the iPhone Simulator. You should see the screen shown in Figure 5-2.
  5. At the top-left corner of the Xcode window, select the iPad 5.0 Simulator scheme (see Figure 5-3).

    image

    FIGURE 5-2

    image

    FIGURE 5-3

  6. Press Command-R again. This ...

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