私は各タブにUINavigationテンプレートを持つテンプレートとして持っているtabBarApplicationを持っていました。UIViewController上でUINavigation ControllerをrootViewとして設定する
私はそのサンプル(並べ替え)を使用して、それをnotherアプリケーションの単一のUIViewControllerに変換したいと思います。私は2つのコードを提示しました。最初のものはテンプレート、後者は私が作ろうとしているものです。誰でも私にいくつかのヒントを与えたり、その権利をどうやって手伝ってもらえますか?私はエラーが発生し続けるが、tabBarAppはviewControllerが宣言していないので、私には意味をなさない。
最初のコード(例):コードのフェッチ部分が既に設定コアデータに関連する
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[self setupFetchedResultsController];
if (![[self.fetchedResultsController fetchedObjects] count] > 0) {
NSLog(@"!!!!! ~~> There's nothing in the database so defaults will be inserted");
[self importCoreDataDefaultRoles];
}
else {
UIViewController *mainViewController = (UIViewController *)self.window.rootViewController;
UINavigationController *readingsTVCnav = [[mainViewController viewController] objectAtIndex:0];
// Override point for customization after application launch.
return YES;
}
:(私が作るしようとしています)
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[self setupFetchedResultsController];
if (![[self.fetchedResultsController fetchedObjects] count] > 0) {
NSLog(@"!!!!! ~~> There's nothing in the database so defaults will be inserted");
[self importCoreDataDefaultRoles];
}
else {
NSLog(@"There's stuff in the database so skipping the import of default data");
}
// The Tab Bar
UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;
// The Two Navigation Controllers attached to the Tab Bar (At Tab Bar Indexes 0 and 1)
UINavigationController *personsTVCnav = [[tabBarController viewControllers] objectAtIndex:0];
UINavigationController *rolesTVCnav = [[tabBarController viewControllers] objectAtIndex:1];
return YES;
}
第二の符号仕事と仕事。 この変更の理由は、tabBarConfigurationではなく、初期画面としてプレーン・ビュー・コントローラーを設定する必要があるためです。
乾杯ジェフ
編集:私はあなたがあなたのイメージで記述し、描いたものから明瞭
新しいナビゲーションの仕組みがわからない。あなたの最初のビューコントローラはナビゲーションコントローラですか? – jonkroll
はい、私はストーリーボードを使用しており、私はUINavigationコントローラ内にViewControllerを埋め込んでいます。 –
埋め込みViewControllerには何がありますか?あなたはどのようにあなたのアプリの他の部分に移動しますか? – jonkroll