Chapter 5. Multi-Platform Support for the iPhone and iPad

WHAT YOU WILL LEARN IN THIS CHAPTER

  • Modifying a project's Targeted Device Family setting to support both the iPhone and the iPad

  • How to programmatically detect the device being run

  • How to create a Universal application

  • Creating separate targets for different devices

Besides the iPhone and iPod touch, another device using the iOS is the iPad. Out-of-the-box, the iPad will run your existing iPhone applications using the same screen size that is available on the iPhone and iPod touch — 320 × 480 pixels. Therefore, your applications will utilize only a portion of the screen. However, applications running in this default mode do not do justice to the much bigger screen real estate afforded by the iPad. Clearly, this is merely an interim size that can be used until developers port their application's UI to the much bigger iPad screen. In order to support the different devices, you need to modify your applications so that they can take advantage of the capabilities of each device type.

Though the iPad is also running the iPhone OS, you should be aware of some subtle differences when porting your applications over to the new device. This chapter examines three techniques you can use to port your existing iPhone apps to support both the iPhone and iPad.

Note

At the time of writing, the iPad runs an older version of the iPhone OS, 3.2; whereas the iPhone 4 and iPod touch run the newer 4.0. Apple has announced that the iPad will be running ...

Get Beginning iOS 4 Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.