2012-05-03 13 views
9

皆さん 私は現在、新しいアプリケーション用のログインとパスワードインターフェイスを開発しています。パスワードとログインがOKの場合に限り、条件付きでsegueを実行したいと思います。ストーリーボードに "push"スタイルと "loginMainIdentifier"スタイルでSegueを作成しました。私はそれがコードの末尾に[self performSegueWithIdentifier:@"loginMainSegue" sender:self]では動作しない理由を理解しないStoryboard Segueのプログラムによる実行

- (IBAction)pushValidateButton:(id)sender { 

    if([loginText.text isEqualToString:@""] || [passwordText.text isEqualToString:@""]) 
    { 
     UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Identification" message:@"Veuillez completer l'ensemble des cases SVP" delegate:self cancelButtonTitle:@"Revenir" otherButtonTitles:nil]; 
     alert.alertViewStyle = UIAlertViewStyleDefault; 
     [alert show]; 
    } 

    if(![loginText.text isEqualToString:@""] && ![passwordText.text isEqualToString:@""]) 
    { 
    //creation of the request 
     NSMutableString *string = [[NSMutableString alloc] initWithCapacity:100]; 
     NSString *string01 = @"http://89.82.227.112/Vico/login.php?l=&m="; 


     [string appendFormat:string01]; 
     NSString *string02 = loginText.text; 
     NSString *string03 = passwordText.text; 

     [string insertString:string03 atIndex:41]; 
     [string insertString:string02 atIndex:38]; 

     NSURLRequest *request01=[NSURLRequest requestWithURL:[NSURL URLWithString:string]cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0]; 

    //create the connection and start loading data 

     NSURLConnection *connection01 = [[NSURLConnection alloc] initWithRequest:request01 delegate:self]; 
     if(connection01) 
     { 
     //Create NSMutableData to receive data 
     //receiveddata is an instance declared elsewhere 
     receivedData = [NSMutableData data]; 
     } 
    } 
    [self performSegueWithIdentifier:@"loginMainSegue" sender:self]; 
} 

次のように実装フォルダが書かれています。

誰かが、ログインとテキストがいっぱいになった場合にのみ、segueを実行するために欠けているものの手がかりを持っていますか?

は名前が正しく入力されている場合(あなたがコードで、その後loginMainSegueトップloginMainIdentifier、上で書いた)チェック

ビクター

答えて

5

ありがとうございます。

また、このsegueが全体のviewControllerから接続先のviewControllerに接続されているかどうかを確認してください。

+0

大変ありがとうございます。スペルミスは私の投稿にありました。しかし、ViewController全体へのSegueの接続を変更しています。ありがとうございました。ビクター –

関連する問題