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を使用しています。
おかげで、
テート
gamedev.stackexchange.comに移行しますか? – AttackingHobo
ええと...なぜ?私は他のすべての質問をここで尋ねました。 – tallen11
何が問題なのですか? – ughoavgfhw