开发者

Multiple video downloading using NSOperationQueue

I have code following lines to start multiple downloads from my application. The problem is, the NSInvocation开发者_开发知识库Queue 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜