Question

We can upgrade an iPhone project to iPad project as mentioned in the link: http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/iphone_development/120-Building_and_Running_Applications/building_and_running_applications.html

But, I am having an project that is created for iPad. Now, I want to create another target for iPhone (supporting OS same as iPad). How do I do this?

Thanks and Regards, Deepa

Was it helpful?

Solution

You probably do not want to create a new target for iPhone. What you want is to have a single target that creates a universal application that runs on both iPad and iPhone/iPod touch.

First go to the project settings and change the setting for "Target Device Family" from "iPad" to "iPhone/iPad".

Secondly you will also need two MainMenu.nibs, one for iPad and one for iPhone. You do this in the Info.plist for your target. The key NSMainNibFile should name the nib for iPHone, add a key named NSMainNibFile~iPad to name the nib for iPad.

Now the app is ready to run on both devices, (until you try to use UIPopoverController or other iPad specific class on the phone). Rest of the work is just to make it pleasant, one view at the time.

Use the run-time check [UIDevice currentDevice].userInterfaceIdiom to check at run-time what kind of device you are running. To choose different nibs to load, and other user experience differences.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top