ABCustomUINavigationController を使用しています。このようにストーリーボードを初期化したいのですが、常にエラーが発生します
LoginViewController *loginViewController = [[LoginViewController alloc] init] ;
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
loginViewController = [[LoginViewController alloc] initWithNibName:@"LoginViewController" bundle:nil];
} else {
loginViewController = [[LoginViewController alloc] initWithNibName:@"LoginViewControllerPad" bundle:nil];
}
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
//self.window.rootViewController = [[FlipSquaresNavigationController alloc] initWithRootViewController:self.viewController];
self.window.rootViewController = [[FlipSquaresNavigationController alloc] initWithRootViewController:loginViewController];
[self.window makeKeyAndVisible];
別の試み
NSString *nibName = [[NSString alloc] init] ;
NSString *storyBoard = [[NSString alloc] init] ;
if ( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ) {
//iPad
nibName = @"LoginViewControllerPad" ;
storyBoard = @"Main_iPad" ;
}else {
//iPhone
nibName = @"LoginViewController" ;
storyBoard = @"Main_iPhone" ;
}
// UINavigationController *navigationController = (UINavigationController *)self.window.rootViewController;
UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:storyBoard bundle: nil];
LoginViewController *loginViewController = (LoginViewController *)[mainStoryboard instantiateViewControllerWithIdentifier: nibName];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
//self.window.rootViewController = [[FlipSquaresNavigationController alloc] initWithRootViewController:self.viewController];
self.window.rootViewController = [[FlipSquaresNavigationController alloc] initWithRootViewController:loginViewController];
2014-04-22 19:13:27.744 マッチング [791:60b] 私は restkit:RKLog.m:33 RestKit ログを初期化しました... 2014-04-22 19:13:28.218 Matching[791:60b] *** キャッチされていない例外 'NSInternalInconsistencyException' が原因でアプリを終了しています。 ' *** 最初のスロー コール スタック: (0x2f457f4b 0x397e76af 0x2f457e8d 0x31f29e39 0x31e8b917 0x31ced389 0x31bcf1bd 0x31bcf139 0x31c46dd5 0x31c4574d 0x31c4529b 0x31c45223 0x31c451bb 0x31c3dcb9 0x31bd0db7 0x31c44f09 0x31c449d5 0x31bd5f95 0x31bd34db 0x31c3e08d 0x91e29 0x31c3b2ff 0x31c3ad4f 0x31c35353 0x31bd041f 0x31bcf721 0x31c34b3d 0x3406b70d 0x3406b2f7 0x2f4229df 0x2f42297b 0x2f42114f 0x2f38bc27 0x2f38ba0b 0x31c33dd9 0x31c2f049 0xbc49d 0x39cefab7) libc++abi.dylib: タイプ NSException のキャッチされない例外で終了します (lldb)