所以我有问题这样做。这段代码不会按我想要的方式工作。
if (answer.text == @"text") {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"title" message:@"message" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[alert show];
[alert release];
}else{
UIAlertView *alert1 = [[UIAlertView alloc] initWithTitle:@"title 2" message:@"Title 2" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[alert1 show];
[alert1 release];
}
我的问题是文本框“答案”中有文本“文本”,它不会执行第一个 UIAlertView。它总是执行 else{} 中的那个。此代码也在按钮的 IBAction 中。现在任何帮助都是好的。