UIAlertView cerrar la App
-
18-09-2019 - |
Pregunta
en mi proyecto de mi aplicación primero intenta conectarse a Internet, pero ahora tengo que comprobar si hay una conexión disponible! así que hice un if, else dentro de un UIAlertView en la parte más!
Pero cómo puedo cerrar toda la aplicación en un clic en el botón siguiente?
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Keine Internetverbindung" message:@"Es konnte keine Verbindung zu www.sip.de hergestellt werden!" delegate:nil cancelButtonTitle:@"Schliessen" otherButtonTitles:nil];
Gracias a todos por ayudar de antemano
saluda Marco
Solución
.h
@interface UntitledViewController: UIViewController
archivo .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);
}
esperanza esto ayuda
Otros consejos
UIalertViewConfigure:
UIAlertView * applicationExitAlert = [[UIAlertView alloc] initWithTitle: @ mensaje "Salir": @ "es usted Wanto que sale de esta aplicación" delegado: auto cancelButtonTitle: @ "Cancelar" otherButtonTitles: @ "OK", nil];
[Mostrar applicationExitAlert]; [Liberación applicationExitAlert];
UIAlertViewDelegate:
- (void) alertView: (UIAlertView *) alertView clickedButtonAtIndex: (NSInteger) buttonIndex { si (buttonIndex == 1) { de salida (0); } }
espero su trabajo