Reputation: 461
in my project my app first tries to connect to the internet, but now i have to check if there is an connection available! so i made an if, else within an UIAlertView in the else part!
but how can i close the whole app on a click on the following button?
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Keine Internetverbindung" message:@"Es konnte keine Verbindung zu www.sip.de hergestellt werden!" delegate:nil cancelButtonTitle:@"Schliessen" otherButtonTitles:nil];
thank you all for helping beforehand
greets Marco
Upvotes: 1
Views: 2550
Reputation: 1795
UIalertViewConfigure:
UIAlertView *applicationExitAlert = [[UIAlertView alloc] initWithTitle:@"Exit" message:@"Are You wanto to exits this App" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK",nil];
[applicationExitAlert show]; [applicationExitAlert release];
UIAlertViewDelegate:
i hope its work
Upvotes: 0
Reputation: 6510
.h file
@interface UntitledViewController : UIViewController < UIAlertViewDelegate > { }
.m file
- (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);
}
hope this helps
Upvotes: 1