У меня есть счетчик крана, и это код "Кто победит". Приложение вылетает всякий раз, когда Flipped (int timer) равен 30, и он решает, у кого было больше нажатий. Он всегда говорит "Player 2 Wins" и зависает. Пожалуйста помоги. Число - это числовое значение одного устройства, Число 1 - это значение второго устройства. Как мне это исправить?
- (void)countup
{
if (Fliped == 30)
{
//error message
if (Number < Number1)
{
myAlertView = [[UIAlertView alloc] initWithTitle:@"Stop!" message:@"Player 2 Wins!" delegate:self
cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
timer = [NSTimer scheduledTimerWithTimeInterval:0.0
target:self selector:@selector(countup)userInfo:nil repeats:YES];
[myAlertView show];
}
if (Number > Number1)
{
myAlertView = [[UIAlertView alloc] initWithTitle:@"Stop!" message:@"Player 1 Wins!" delegate:self
cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
timer = [NSTimer scheduledTimerWithTimeInterval:0.0
target:self selector:@selector(countup)userInfo:nil repeats:YES];
[myAlertView show];
}
else
{
MainInt += 1;
seconds.text = [NSString stringWithFormat:@"%d", MainInt];
Fliped += 1;
secondsFlip.text = [NSString stringWithFormat:@"%d", Fliped];
}
}
Заранее спасибо.
что может быть причиной этого сбоя ???