我有代码以下行来从我的应用程序开始多次下载。问题是,NSInvocationQueue没有调用选择器方法,即下载我的视频。使用NSOperationQueue的多视频下载
任何人都可以让我知道,下面的代码究竟出了什么问题?
- (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];
}
您是否看到(多个)内存泄漏?因为我认为我是。 –
@Jacob:是的!或者,也许是时候开始习惯ARC问题了...... – jtbandes
@jtbandes:啊! ;) –