开发者

Multiple video downloading using NSOperationQueue

开发者 https://www.devze.com 2023-03-22 11:29 出处:网络
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.

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

精彩评论

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