アプリケーションでコードを実行しているときにエラーが発生しました。タスクは、アラート後に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)