NavigationController には、TabBarController があります。UINavigationItem のサブクラスである TabBarController の NavigationItem のカスタム クラスがあります。私の NavigationItem には、UIButton を含む TabBarButtonItem があります。このボタンのアクションを定義しました。私の質問は、このアクションから他のビューにプログラムでプッシュするにはどうすればよいですか? このクラスでナビゲーションコントローラーを取得するにはどうすればよいですか? または、これには別の方法がありますか?
.h:
@interface CustomNavigationItem : UINavigationItem
{
IBOutlet UIBarButtonItem *barbtnApply;
IBOutlet UIButton *btnApply;
}
@property(nonatomic,retain) UIBarButtonItem *barbtnApply;
@property(nonatomic,retain) UIButton *btnApply;
-(IBAction)actionApply:(id)sender;
@end
.m:
@implementation CustomNavigationItem
@synthesize btnApply = _btnApply;
@synthesize barbtnApply = _barbtnApply;
-(IBAction)actionApply:(id)sender
{
btnApply = sender;
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"test" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
//push to other view
}
@end