私のストーリーボードは次のようなものです:
ナビゲーションコントローラーから、タブコントローラーに行きます。私のタブコントローラーには、MYTabBarViewという名前のクラスがあります
MyTabBarView.m の ViewDidLoad メソッドで、次のようにプログラムで右バー ボタン項目を作成しました。
UIBarButtonItem *homeButton = [[UIBarButtonItem alloc] initWithTitle:@"Home" style:UIBarButtonSystemItemAction target:self action:@selector(homeButtonAction)];
self.navigationItem.rightBarButtonItem=homeButton;
私の質問は、そのアクションをどのように書くかです。つまり、ストーリーボードに表示されるボタンであれば、.h ファイルと .m ファイルに「ドラッグ アンド ドロップ」します。
メソッド:
今、私は何をすべきですか?
- (IBAction)home:(id)sender {
....
}