View Full Version : iphone/ipad

Aug 4, 2011, 02:52 AM
how can i develop app for both iphone and ipad ?

just in general i mean about images and design and something like that?


Aug 4, 2011, 03:00 AM
If you click in Xcode project, on your target, and make it instead of an iPhone/iPad -> Universal build (this is Xcode 4.0+).
Then you get 2 MainWindow.xib's, one is for iPhone, other is called iPad.
Then you can just make 2 groups in your project, one for iPhone, one for iPad.
And then decide what you gonna do, are you gonna make shared classes, or one seperate for both.
And if your class doesn't do that much, and only needs 1 change depending on what device you are, there is some code for that.

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone){
NSLog(@"woopwoop i'm a phone");
} else {
NSLog(@"i'm a pad dawg");

About images, you can set them via code, and you have to provide the right resolutions, it's a bit of a hussle in the beginning, but it works perfectly :)