2011-01-11 9 views
0

正しいコードを入力してもユーザーが新しいシーンに誘導しようとしていますが、動作しません。ここでは、コードは次のとおりです。UIAlertViewとUITextFieldsが機能しない

- (void)showCodes:(id)sender { 
    alert = [[UIAlertView alloc] initWithTitle:@"Codes" message:@"Enter a code." delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Enter", nil]; 
    code = [[UITextField alloc] initWithFrame:CGRectMake(12, 45, 260, 25)]; 
    CGAffineTransform myTransform = CGAffineTransformMakeTranslation(0, 60); 
    [alert setTransform:myTransform]; 

    [code setBackgroundColor:[UIColor whiteColor]]; 
    [alert addSubview:code]; 
    [alert show]; 
    [code retain]; 
} 

- (void)alertView:(UIAlertView*)alertView clickedButtonAtIndex:(NSInteger)buttonIndex 
{ 
if (buttonIndex == 1) { 
    NSString *text = code.text; 
    NSString *othermode; 
    bernierMode = @"epicmode"; 
    if (text == nil) { 
     //nothing 
    } 
    else if(text == othermode) 
    { 
     //go to other view... 
    } 
    else { 

    } 
} 
} 

私はまた、UIAlertViewデリゲートを設定し、私のヘッダファイルに(それが違いを作るとは思わない)cocos2Dを使用しています。

おかげで、

テート

+1

gamedev.stackexchange.comに移行しますか? – AttackingHobo

+0

ええと...なぜ?私は他のすべての質問をここで尋ねました。 – tallen11

+0

何が問題なのですか? – ughoavgfhw

答えて

0

Gaming - Stack Exchangeはあなたのためのより良いサイトになります。そのサイトは、ゲームコードのすべてのニーズに特有のものです。

関連する問題