得到的警告:
UIAlertView *connectionError = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Connection Failed" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
我想知道能不能编程关闭打开特定事件时的警告视图。我知道没有特定的调用。但是我记得有些人在按钮上直接调用但是怎么取消警告?
得到的警告:
UIAlertView *connectionError = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Connection Failed" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
我想知道能不能编程关闭打开特定事件时的警告视图。我知道没有特定的调用。但是我记得有些人在按钮上直接调用但是怎么取消警告?
使用-dismissWithClickedButtonIndex:animated:
。这个方法可以取消警告视图。
[connectionError dismissWithClickedButtonIndex: connectionError.cancelButtonIndex animated: YES];
这是关闭警告的接口。