私はナビゲーションコントローラーを持っており、その中にビューコントローラーがあります:
-NavigationController1
--MyViewController
また、別のナビゲーション コントローラー、NavigationController2 もあります。NavigationController2 にプッシュされた別のビュー コントローラー (ViewController2) から MyViewController を呼び出したいと思います。-NavigationController2 --ViewController2
私は次の方法でそれを行います:
@implementation ModifyDicVController
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    self.navigationItem.rightBarButtonItem = [ [ [UIBarButtonItem alloc]
                    initWithBarButtonSystemItem:
                    UIBarButtonSystemItemAdd target:self
                    action:@selector(add_clicked)] autorelease];
}
-(void) add_clicked
{
    [navigationController pushViewController: addWordsVController animated: YES];
}
@end
そして、これが MyViewController の viewWillAppear メソッド (呼び出されているもの) です。
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [self setTitle: @"My title"];
}
ユーザーがテキスト フィールドの編集を開始したときに、ナビゲーション バーに「完了」ボタンを追加しています。
- (void) textFieldDidBeginEditing: (UITextField *) textField
{ 
    self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] 
                initWithTitle: NSLocalizedString(@"button: done", @"")
                style:UIBarButtonItemStyleDone 
                target:self 
                action:@selector(doneEditing)] 
                autorelease];
}
問題は、NavigationController2 にプッシュされた ViewController2 から MyViewController を呼び出し、その後独自の NavigationController1 から MyViewController を呼び出すと、ナビゲーション バーのタイトルと完了ボタンが追加されないことです。ただし、MyViewController の viewWillAppear および textFieldDidBeginEditing メソッドが呼び出されています。
何が問題で、どうすれば修正できますか?
ありがとう。