だから私はテーブルビューでルートビューを持っています。次のようなツールバーを表示します。
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.navigationController.toolbarHidden = NO;
}
そして、setToolbarItemsメソッドを実装します。
- (void)setToolbarItems:(NSArray *)toolbarItems animated:(BOOL)animated
{
UIBarButtonItem *buttonItem;
buttonItem = [[UIBarButtonItem alloc] initWithTitle:@"Hello" style:UIBarButtonItemStyleDone target:self action:@selector(goBack:)];
self.navigationController.toolbarItems = [ NSArray arrayWithObject: buttonItem ];
}
結果は空のトールバーです。なんで?