FirstViewController.xibとSecondViewController.xibを提供する新しい「タブバーアプリ」プロジェクトを作成しました。
AppDelegate
タブバーでは、コントローラーは次のように構成されています。
UIViewController *viewController1 = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];
UIViewController *viewController2 = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];
self.tabBarController = [[UITabBarController alloc] init];
self.tabBarController.viewControllers = [NSArray arrayWithObjects:viewController1, viewController2, nil];
self.window.rootViewController = self.tabBarController;
これは明らかにnibファイルからのインスタンスをロードしますUIViewController
ね。しかし、SecondViewController.xibを開くと、表示されるルートレベルのオブジェクトはビューコントローラーのビューだけです。UIViewController
インスタンス全体が実際にはそのペン先から出ていると私は信じているので、これは私には意味がありません。
残りはどこですか?UIViewController
タイトルなどのプロパティが表示されないのはなぜですか?[ファイル所有者]をクリックすると、[ID]タブに「SecondViewController」と表示されるので、ファイル所有者は間違いなくですがUIViewController
、nibにアーカイブされていないようです。実際、インスタンスはプログラムで作成されているようで、nibはビューのみをアーカイブしているようです。
nibファイルの名前がSecondViewController.xibであるため、混乱を招きます。誰かが明確にすることができますか?