我有UIAlertView的问题,我不明白。我无法让它工作。我在测试过程中更改了代码,所以按下按钮时UIAlertView应该直接点击。无法让UIAlertView正常工作
我已经测试了断点/调试器,当按下按钮时发生了什么,它停在的第一行是“otherButtonTitles:nil”;“。
我在应用程序的其他部分测试了一段代码,它工作正常。
我不知道我做错了什么。
- (IBAction)startNewGame_Button:(id)sender {
UIAlertView *noPlayersAlert = [[UIAlertView alloc] initWithTitle:@"VARNING"
message:@"Ingen spelare är vald!\n \n Välj spelare och försök igen!"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[noPlayersAlert show];
[noPlayersAlert release];
...
}
============== UPDATE =====================
当我复制这段代码到另一个按钮的作用?
在这里它是在一条线,测试具有相同的结果:
UIAlertView *noPlayersAlert = [[UIAlertView alloc] initWithTitle:@"VARNING" message:@"Ingen spelare är vald!\n \n Välj spelare och försök igen!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
==============更新#2 ======== ==========
问题解决了,即使我不明白原因,因为我在测试过程中移除了“退出(0)”,远远低于UIAlertView。
感谢大家谁回答:)
设置代表自我。错误显示了整行错误的代码。你可以将上面的代码(uialertview实现)写在一行中 – 0xDE4E15B 2011-01-29 22:57:24