ナビゲーションコントローラーを正しく実行するのに問題があります!RootViewControllerでテーブルのセルをクリックすると、次のViewControllerではないように見えます。
エラーメッセージは次のようになります
「アプリケーションがnilviewコントローラーをターゲットにプッシュしようとしました。」</p>
だから私は何か間違ったことを割り当てます、私の推測でした、私はおそらく私がフォローしている本から重要な何かを見逃しています。
したがって、問題は私のRootViewController.mに表示されます。
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
UINavigationController *navigationController= [[UINavigationController alloc]init];
switch ([indexPath row]) {
case 0:
[navigationController pushViewController:kundeViewCon animated:YES];
break;
case 1:
[navigationController pushViewController:kalenderViewCon animated:YES];
break;
case 2:
[navigationController pushViewController:wunschViewCon animated:YES];
break;
}
}
私のAppDelegate.mでは、RootViewControllerをNavigationControllerとして設定するために次のことを行っています。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
// Navigation Controller
RootViewController *rootViewController = [[RootViewController alloc]init];
navigationController = [[UINavigationController alloc]initWithRootViewController:rootViewController];
self.window.backgroundColor = [UIColor whiteColor];
[self.window addSubview:navigationController.view];
[self.window makeKeyAndVisible];
return YES;
}
そのため、セルをクリックすると、プッシュしたい他のすべてのViewControllerを取得しました。自分のせいや足りないものが見えない!?
多分誰かが私を助けて私にヒントを与えることができます!それは素晴らしいことです!