我有代碼以下行來從我的應用程序開始多次下載。問題是,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:啊! ;) –