I have code following lines to start multiple downloads from my application. The problem is, the NSInvocationQueue is not calling selector method, i.e. downloadMyVideos.
Can please anyone let me know, exactly what is wrong with following code?
- (void)viewWillAppear:(BOOL)animated
{
[operationQueue cancelAllOperations];
operationQueue = [[NSOperationQueue alloc] init];
[operationQueue setSuspended:YES];
indexOperation = [[NSInvocationOperation alloc]initWithTarget:self selector:@selector(downloadMyVideo) object:nil];
[operationQueue addOperation:indexOperation];
}
You’ve suspended your queue.
Operations that you add to a suspended queue are not run. That could be your problem, unless you are starting the queue elsewhere.