在我的应用程序中执行代码时出错,任务是在警报后重定向到 url。但关于我猜是正确的代码。这是我的代码
- (void) alertStatus:(NSString *)msg :(NSString *)title :(int)tag
{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:title
message:msg
delegate:self
cancelButtonTitle:@"Ok"
otherButtonTitles:nil, nil];
if (tag) alert.tag = tag;
{
[alertView show];
}
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if(alertView.tag == 101)
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: @"http://ABC.company.com"]];
//[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];
}
}
错误显示在该行
if (tag) alert.tag = tag;(Use of undeclared identifier:alert)