在我的项目我应用程序第一次尝试连接到互联网,但现在我必须检查是否有一个连接提供!所以我做了个如果其他内UIAlertView在别的部分!

但我怎么能接近整体的应用程序上的点击,在以下按钮吗?

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Keine Internetverbindung" message:@"Es konnte keine Verbindung zu www.sip.de hergestellt werden!" delegate:nil cancelButtonTitle:@"Schliessen" otherButtonTitles:nil];

感谢你们的帮助事先

欢迎马可

有帮助吗?

解决方案

h文件

@interface UntitledViewController:的UIViewController { }

.m文件


- (void)viewDidLoad {
    [super viewDidLoad];

    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Keine Internetverbindung" message:@"Es konnte keine Verbindung zu www.sip.de hergestellt werden!" delegate:nil cancelButtonTitle:@"Schliessen" otherButtonTitles:nil];

    [alert setDelegate:self];
    [alert show];
    [alert release];
}

- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
    exit(0);
}

希望这有助于

其他提示

UIalertViewConfigure:

UIAlertView*applicationExitAlert=[[UIAlertView分配]initWithTitle:@"退出"信息:@"你到杭州万拓退出这个程序"委托:自cancelButtonTitle:@"取消"otherButtonTitles:@"确定"、"无"];

[applicationExitAlert展];[applicationExitAlert释放];

UIAlertViewDelegate:

  • (void)alertView:(UIAlertView*)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{ 如果(buttonIndex==1){ 出口(0);} }

我希望它的工作

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top