こんにちは、X コードを使用して iPhone でタブバー アプリケーションを作成したいと考えています。そのため、ViewDidLoad メソッドでタブバーを作成します。
- (void)viewDidLoad {
NSLog(@"in Home");
tabBarController = [[UITabBarController alloc] init];
homeViewController = [[HomeViewController alloc]init];
NextViewController = [[NextViewController alloc]init];
tabBarController.viewControllers = [NSArray arrayWithObjects:homeViewController,nextViewController,nil];
window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
[window addSubview:tabBarController.view];
[window makeKeyAndVisible];
[super viewDidLoad];
}
コンパイルして実行すると、HomeViewが何度も呼び出され、2番目のタブをタップしてもNextViewは呼び出されません。
それで、このコードのどこが間違っているのですか Plzは私を助けて..