这是我上一个问题的后续
我有这个代码
基本上,它的意思是,当计时器到达时,您会收到一个消息框,说“做得好”等,然后屏幕重置,您可以再次玩,所有图像重置,开始按钮重新出现,但您无法清除警报框刚刚卡住在SIM卡上,我是不是错过了什么?
这是代码
if (MainInt <= 0)
{
[timer invalidate];
timelabel.text = @"5";
[startbutton setHidden:NO];
CGRect frame = [player frame];
frame.origin.x = 137.0f;
frame.origin.y = 326.0;
[player setFrame:frame];
CGRect frame2 = [enemy frame];
frame2.origin.x = 90.0f;
frame2.origin.y = 20.0;
[enemy setFrame:frame2];
CGRect frame3 = [enemy2 frame];
frame3.origin.x = 210.0f;
frame3.origin.y = 20.0;
[enemy2 setFrame:frame3];
UIAlertView *alert1 = [[UIAlertView alloc] initWithTitle:@"GRATZ" message:[NSString stringWithFormat: @"Congratulations you made it to Level : %d Now try then next level" ,fred] delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil];
[alert1 show];
[alert1 release];
}
最佳答案
听起来您正在创建多个并将它们放在一起。
尝试重置您的 MainInt = 5;
就像您在上一个问题中重置 timeLabel.text
关于iphone - if 语句后警报框在模拟器上卡住,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11070218/