i want my application to execute a specific me开发者_运维问答thod each 10 minutes while in background It is possible ? Thanks
If I understood your question correctly... do you mean after the user hits the Home button?
If so, then I believe it is not possible to do what you want to do.
From apple docs the iOS application can become active in the background to do one or more of the following:
Task completion: when the app starts a task and the user hit the home button the app can ask to continue doing the task for a limited time in the background then enters the suspended state
Location: the app becomes active for limited time when location change is triggered.
For playing audio
VOIP
Have a look at the multitasking guidelines docs.
Cheers
minutesTimer = [NSTimer scheduledTimerWithTimeInterval:60*10 target:self selector:@selector(update) userInfo:NULL repeats:YES];
if ([countTimer isValid]==NO)
{
countTimer=[NSTimer scheduledTimerWithTimeInterval:600 target:self selector:@selector(YourMethod) userInfo:nil repeats:YES];
}
精彩评论