ナビゲーションビューの動作が非常に奇妙です。私が欲しいのは、私のメインビューから、ユーザーがボタンに触れることができるということです。これにより、ユーザーはアプリケーション設定のあるビューに移動します。
ナビゲーションを担当するコードは次のとおりです。
AppDelegate.h
@interface AppDelegate:NSObject { UIWindow * window; ViewController * viewController; //私のメインビューコントローラー UINavigationController * NavigationController; } @property(非アトミック、保持)IBOutlet UIWindow * window; @property(非アトミック、保持)IBOutlet ViewController * viewController; @property(非アトミック、保持)IBOutlet UINavigationController * NavigationController;
AppDelegate.m
@synthesize viewController; @synthesizeウィンドウ; @synthesize NavigationController; -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [ウィンドウaddSubview:viewController.view]; [ウィンドウaddSubview:navigationController.view]; [ウィンドウmakeKeyAndVisible]; YESを返します。 }
viewController.h
#輸入 #import "optionsViewController.h"//'設定'ビューコントローラー
@class AppDelegate; @interface ViewController:UIViewController { AppDelegate * appDelegate;
viewController.m
-(IBAction)showOptionsViewController:(UIBarButtonItem *)sender { // optionsController.theSubjectID = self.theSubjectID; // [self presentModalViewController:self.optionsControllerアニメーション:YES]; optionsViewController * optionsController = [[optionsViewController alloc] initWithNibName:@ "optionsViewController" bundle:nil]; optionsController.theSubjectID = self.theSubjectID; [self.navigationController pushViewController:optionsControllerアニメーション:YES]; [optionsControllerリリース]; }
私のoptionsControllerは「通常の」UIViewControllerです。ご覧のとおり、optionsControllerの負荷をモーダルからナビゲーションに変更しました。ここで何かを逃したのでしょうか?
事前にヒントをありがとう。
乾杯、ルネ