CHOOSING A PORTING TECHNIQUE

Now that you have seen the two techniques for porting your iPhone application to support the iPad, which technique should you adopt?

If your application does not have many UI changes when running on either the iPhone or the iPad, using the first technique (modifying the device target setting) is the easiest way to support two platforms without changing much code, and it uses a single set of XIB files. All you need to do is ensure that when the application runs on the iPad, the UI is rearranged correctly — this can be done programmatically in your View Controller or set in Interface Builder. Most developers should benefit from creating Universal applications. When you have an application that supports two different platforms, creating a Universal application enables you to have one code base with several XIB files designed specifically for the iPhone and the iPad. This technique saves you the trouble of uploading two different editions of your application to the AppStore. You need to upload just one version of your application and it will automatically support both platforms.

Get Beginning iOS 5 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.