UIAlertview ボタンからビューコントローラーを表示しようとすると、非常に奇妙なエラーが発生しました。prsentViewController 行でクラッシュしました。バックトレースは、ビューのロードに失敗したことを示しています。どうすればこれを修正できますか? ソースコードは以下です。
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (alertView == _alertView) {
switch (buttonIndex) {
case 0:
{
[alertView dismissWithClickedButtonIndex:buttonIndex animated:YES];
}
break;
default:
{
NSString *nibName = IS_IPAD? NSStringFromClass([UINewUserAccountViewController class]) : [NSStringFromClass([UINewUserAccountViewController class]) stringByAppendingString:@"~iPhone"];
UINewUserAccountViewController *newUserAccountViewController = [[UINewUserAccountViewController alloc] initWithNibName:nibName bundle:nil];
newUserAccountViewController.delegate = self;
UINavigationController *navi = [[UINavigationController alloc] initWithRootViewController:newUserAccountViewController];
[self presentViewController:navi animated:YES completion:nil];
}
break;
}
}
}