I have downloaded information from an url, and I am sending this url as NSOperation in an NSOperationQueue, I want to know, how I can delete a specific NSOperation to download data for a specific url, now I am doing in this way:
AppDelegate *appController = (AppDelegate *) [[UIApplication sharedApplication] delegate];
for (NSOperation *op in appController.seriesQueue.operations) {
if ([op isKindOfClass:[MyDowndload class]]) {
MyDownload *urlInDownload = (MyDowndload *)op;
if ([urlInDownload.myNew.urlName isEqualToString:[managedObject valueForKey:@"urlName"]] && [urlInDownload.myNew.language isEqualToString:[managedObject valueForKey:@"language"]]) {
[op cancel];
}
}
}
I have the information in a tableview, so when I delete a row for index path I enter in this check, and enter also in the [op cancel] line, but I can see in the console log that the thread is still downloading, how can I stop and delete it?
url.myNew.language
in if condition. Is it right? orurlInDownload.myNew.language
? – Ilanchezhian