私は現在、異なる UINavigationControllers を必要とするアプリに取り組んでいます。そのため、タブ バーを使用し、UITabBar を使用してそれらを交換しようとしているので、アプリで次のようなコードを委任します。
// Setting up the views for the tab controller
Friends *friends = [[[Friends alloc] initWithNibName:@"Friends" bundle:[NSBundle mainBundle]] autorelease];
WifiManager *wifi = [[[WifiManager alloc] initWithNibName:@"WifiManager" bundle:[NSBundle mainBundle]] autorelease];
UINavigationController *locationController = [[UINavigationController alloc] initWithRootViewController:wifi];
UINavigationController *friendsController = [[UINavigationController alloc] initWithRootViewController:friends];
//Set up the tab controller
tabBarController = [[UITabBarController alloc] init];
tabBarController.viewControllers =
[NSArray arrayWithObjects:locationController, friendsController, nil];
//Add the tab bar to the window
[window addSubview:tabBarController.view];
これにより、最初の UINavigationController がコンパイルされて読み込まれますが、他のナビゲーション コントローラーをクリックすると、次のようになります。
*** -[NSCFData tabBarItem]: unrecognized selector sent to instance 0x1152b0'
最も奇妙な部分は、単一の UINavigationController でタブコントローラーを使用でき、すべてが正常に機能することですが、2番目のものを追加しようとすると、惨めに失敗します-誰かが私がここで間違っていることについて何か考えを持っていますか?
前もって感謝します
ジェームズ