Adam Waite
Adam Waite

Reputation: 18855

Make an iPad app from an existing iPhone app?

If I wanted to make an iPad app from an existing iPhone app that I have released, would I have to create a new project targeted for iPad and create a new app ID and provisioning profile etc, and if so can the app have the same name? Or, do I create it within the existing iPhone targeted project.

Apologies if this question isn't technical enough for this forum...

Thanks.

Upvotes: 1

Views: 1593

Answers (2)

user1609146
user1609146

Reputation: 26

If you don't want to drag all your files over to a new project, i recommend the following:

In your build settings, deployment change the targeted device family to iPad / iPhone from iPhone.

Then for xib files you want to add you iPhone and iPad nib file to the project and an if statement calling the specified nib... I recommend just creating a simple view based project (that is Universal) and then looking at the code... You will see something like this.

self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
    self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil] autorelease];
} else {
    self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPad" bundle:nil] autorelease];
}
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];

You might have to add some supported orientations in you App-Info.plist for the iPad too.

More information can be found here in the section about Universal apps:

http://developer.apple.com/library/ios/documentation/iphone/conceptual/iphoneosprogrammingguide/iPhoneAppProgrammingGuide.pdf

E.

Upvotes: 0

matt
matt

Reputation: 535925

You can create it within the existing iPhone project. Keep the same app ID. Apple will be delighted that you've gone universal. :) I'm assuming here that you mean to go universal. If you mean two separate apps, one for iPhone and one for iPad, that's two different apps; you can share code by using the same project, but they will have different targets and different IDs.

Upvotes: 2

Related Questions