Bonjour à tous,

Désolé je suis débutant en Objective C.

J'essaie de switcher de vue après une action (ici en l'occurrence après avoir envoyé des infos à un webservice PHP, qui ne retourne aucune erreur).

Dans le cas présent, je dois cliquer 2 fois sur le bouton (action confirm) et une page blanche m'est renvoyé :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 
- (IBAction)confirm:(id)sender {
    NSString *pseudo = self.pseudo.text;
    NSString *pass = self.pass.text;
    NSString *email = self.email.text;
    NSString *sexe = [self.sexe titleForSegmentAtIndex:[self.sexe selectedSegmentIndex]];
 
    // Creation de l'appel URL
    NSString *basePath = @"http://devtoo.fr/iOs_HelpCar/index.php?";
    NSString *fullPath = [basePath stringByAppendingFormat:@"pseudo=%@&pass=%@&email=%@&sexe=%@",pseudo,pass,email,sexe];
 
     [iOsRequest requestToPath:fullPath onCompletion:^(NSString *result, NSError *error){
         if(error) {
             [self stopFetching:@"Failed to Fetch"];
         } else {
             UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
             UIViewController *vc = [mainStoryboard instantiateViewControllerWithIdentifier:@"confirmInscription"];
             [self presentViewController:vc animated:YES completion:NULL];
 
         }
     }];
}

Par contre si je "sors" le changement de view de iOsRequest, alors aucun problème la bonne vue s'affiche bien dès le premier clic sur le bouton :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 
- (IBAction)confirm:(id)sender {
    NSString *pseudo = self.pseudo.text;
    NSString *pass = self.pass.text;
    NSString *email = self.email.text;
    NSString *sexe = [self.sexe titleForSegmentAtIndex:[self.sexe selectedSegmentIndex]];
 
    // Creation de l'appel URL
    NSString *basePath = @"http://devtoo.fr/iOs_HelpCar/index.php?";
    NSString *fullPath = [basePath stringByAppendingFormat:@"pseudo=%@&pass=%@&email=%@&sexe=%@",pseudo,pass,email,sexe];
 
     [iOsRequest requestToPath:fullPath onCompletion:^(NSString *result, NSError *error){
         if(error) {
             [self stopFetching:@"Failed to Fetch"];
         } 
     }];
UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
             UIViewController *vc = [mainStoryboard instantiateViewControllerWithIdentifier:@"confirmInscription"];
             [self presentViewController:vc animated:YES completion:NULL];
}
D'avance merci à ceux qui pourront m'orienter