I am implementing a submission queue for the application I am working on. This application is designed to respond to changes in network availability. If there are objects in the queue, and a network connection becomes available, the application will start submitting objects in the queue, which works perfectly when the application is in foreground. What I would like to do, when the application enters the background AND the queue is submitting, is have the queue submission continue until it has attempted to submit all of them.
My method where the queue submits is :
-(void)submitAll {
dispatch_async( dispatch_get_global_queue(DISPTACH_PRIOROITY_DEFAULT,0) ^(void){
self.submitting = TRUE;
for ( id queueObject in theQueue ) {
[self submitQueueObject:queueObject];
}
self.submitting = FALSE;
});
}
Is it possible to have the above loop continiue when the application enters the background?
If you can complete it within about 10 minutes, then you can use
to continue to execute after moving out of the foreground