我的代码:
-(void)loadView {
[super loadView];
self.informationButton = [[UIBarButtonItem alloc] initWithCustomView:[UIButton buttonWithType:UIButtonTypeInfoLight]];
}
- (void)viewDidLoad
{
[super viewDidLoad];
self.navigationItem.leftBarButtonItem = self.informationButton;
self.informationButton.target = self;
self.informationButton.action = @selector(showHelpInfo);
}
-(void)showHelpInfo {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Test"
message:@"Test"
delegate:nil
cancelButtonTitle:@"cansel"
otherButtonTitles:nil, nil];
[alert show];
}
然后我点击我的informationButton
uialertview 不显示。有我的错误吗?