我在编写 AlertView 以推送到新的 ViewController 时遇到问题。我已经遵循了几个教程,但仍然无法使其正常运行。任何帮助,将不胜感激。
- (IBAction)web:(id)sender {
UIAlertView *testAlert = [[UIAlertView alloc] initWithTitle:@"Alert" message:@"You are now entering a website outside of the Company App: Any links or references to other Internet sites (hyperlinks) are provided by Company merely as a convenience to users of this App." delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Proceed", nil];
[testAlert show];
[testAlert release];
}
-(void)web:(UIAlertView *)web clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 0) {
}
else if (buttonIndex == 1) {
JBWebViewController *jbweb = [[JBWebViewController alloc] initWithNibName:@"JBWebViewController" bundle:nil];
[self.navigationController pushViewController:jbweb animated:YES];
}
}