Created
November 16, 2012 12:08
-
-
Save atsu666/4086788 to your computer and use it in GitHub Desktop.
iPhoneとiPadの分離コード
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { | |
// iPhone, iPod Touchの場合の動作 | |
MasterViewController *masterViewController = [[[MasterViewController alloc] initWithNibName:@"MasterViewController_iPhone" bundle:nil] autorelease]; | |
self.navigationController = [[[UINavigationController alloc] initWithRootViewController:masterViewController] autorelease]; | |
self.window.rootViewController = self.navigationController; | |
} else { | |
// iPadの場合の動作 | |
MasterViewController *masterViewController = [[[MasterViewController alloc] initWithNibName:@"MasterViewController_iPhone" bundle:nil] autorelease]; | |
self.navigationController = [[[UINavigationController alloc] initWithRootViewController:masterViewController] autorelease]; | |
self.window.rootViewController = self.navigationController; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment