私のstopWatchプロジェクトでは、アプリケーションがバックグラウンドに移行したときにタイマーを実行したいと思います(iPhoneクロック内の「ストップウォッチ」など)。'beginBackgrounTaskWithExpirationHandler'を試しましたが、タスクは10分までしか実行されません。この制限なしでこれを行うにはどうすればよいですか。誰かがこれを解決する方法を私に助けることができますか....
迅速な返信をありがとう..これが私のコードです:
ViewController.m
- (void)countDown{
count = count - 1;
//until 30 minutes i need to play an animation here...
if(count == 0)
{
//close timer...
[myTimer invalidate];
myTimer = nil;
//update counter again
[self updateCounter];
}
}
//update counter function...
- (void)updateCounter{
//setting count value
count = 1800;
//count-down fun
myTimer = [NSTimer scheduledTimerWithTimeInterval:1.0f target:self selector:@selector(countDown) userInfo:nil repeats:YES];
}
これは私がバックグラウンドでも実行しようとしていることです....助けてください..