右バー ボタン項目をナビゲーション バーに追加して、クリックすると特定の機能が実行されるようにします。
右のバー ボタン アイテムを追加する次のコードを作成しましたが、完了後、バー ボタン アイテムがナビゲーション バーに表示されません。
-(void)viewDidload{
self.navigationItem.rightBarButtonItem =
[[[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemAdd
target:self
action:@selector(Add:)] autorelease];
}
-(IBAction)Add:(id)sender
{
TAddNewJourney *j=[[TAddNewJourney alloc]init];
[app.navigationController pushViewController:j animated:YES];
[j release];
}