HI Frends есть проблема с предупреждением и таймером. Проблема заключается в том:Проблема, связанная с таймером, устройством и симулятором
timer1 = [NSTimer scheduledTimerWithTimeInterval:1.0/30 target:self
selector:@selector(Loop1) userInfo:nil repeats:YES];
timer2 = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self
selector:@selector(timrClock) userInfo:nil repeats:YES];
-(void) timrClock
{
long diff = -((long)[self.now timeIntervalSinceNow]);
timrLabel.text = [NSString stringWithFormat:@"%02d:%02d",(diff/60)%60,diff%60];
if(diff >= timeBankCounter)
{
if(clockTimer != nil)
{
[clockTimer invalidate];
clockTimer = nil;
}
targetButton.userInteractionEnabled = NO;
NSLog(@"RESTART");
NSLog(@"chance:- %d",[[self appDelegate].chance intValue]);
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Time Out!" message:@"Your time is over." delegate:self cancelButtonTitle:@"Try Again." otherButtonTitles:@"Quit"];
[alert show];
[alert release];
//[timer invalidate];
}
}
все идет хорошо на тренажере, но на устройстве оповещения не показывает и приложение terminates.On консоли есть тзд «EXC_BAD_ACCESS» после выше NSLog (@ "шанс --- «).
oh! Я забыл закончить otherButtonTitles ноль. Thanx.I никогда не ожидаю, что ошибка будет здесь, потому что это глупая ошибка. – Jack