Question

I have a question that may look stupid for some of you=) I have a project with 2 targets lets it be "game" and "game-iPad" in summary/devices i choosed iphone for first target and ipad for second I have 2 sets of nib files related to this targets, unfortunately when i try to test my game on iPad the "game" project compiled in device. So I see small window on ipad with ability to scale it to ipad sizes and bundle display name shows that "game" target was compiled. Of cause window of "game-iPad" target has iPad's sizes so it obvious that wron' target is compiled=) how can I compile exact target on idevice("game-iPad")? thanks for all of you for Ur attention and help=)

Was it helpful?

Solution

You should check the Device in the AppDelegate.m's :

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

with something like that

 CGSize iOSDeviceScreenSize = [[UIScreen mainScreen] bounds].size;
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)

....

else if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)

And target your nib in there with something like this:

[[YourViewController alloc] initWithNibName:@"YourViewController" bundle:nil];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top