Question

dans mon projet mon application essaie d'abord de se connecter à Internet, mais maintenant je dois vérifier s'il y a une connexion disponible! donc je l'ai fait un si, dans un autre UIAlertView dans la partie else!

mais comment puis-je fermer l'application tout sur un clic sur le bouton suivant?

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

merci à vous tous pour aider à l'avance

Marco salue

Était-ce utile?

La solution

.h fichier

@interface UntitledViewController: UIViewController { }

fichier .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);
}

espérons que cette aide

Autres conseils

UIalertViewConfigure:

UIAlertView * applicationExitAlert = [[UIAlertView alloc] initWithTitle: @ message "Quitter": @ "êtes-vous WANTO à Quitte cette application" délégué: auto cancelButtonTitle: @ "Annuler" otherButtonTitles: @ "OK", nil];

[applicationExitAlert show]; [Libération applicationExitAlert];

UIAlertViewDelegate:

  • (void) alertView: (UIAlertView *) alertView clickedButtonAtIndex: (NSInteger) buttonIndex { if (buttonIndex == 1) { exit (0); } }

J'espère que son travail

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top