使用NSOperationQueue进行多个视频下载

时间:2011-07-25 05:50:02

标签: iphone nsoperationqueue

我有以下代码来启动我的应用程序的多次下载。问题是,NSInvocationQueue没有调用选择器方法,即 downloadMyVideos

可以请任何人让我知道,以下代码到底出了什么问题?

    - (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];
    }

1 个答案:

答案 0 :(得分:0)

你已经暂停了队列。

不会运行添加到挂起队列的操作。这可能是你的问题,除非你在其他地方开始排队。

相关问题