mzeeshanid / MZDownloadManager

This download manager uses NSURLSession api to download files. It can download multiple files at a time. It can download large files if app is in background. It can resume downloads if app was quit.
BSD 3-Clause "New" or "Revised" License
1.12k stars 238 forks source link

How to remove items from MZDownloadManager's downloadingArray? #57

Closed xtreme8210 closed 7 years ago

xtreme8210 commented 7 years ago

I have run "cancelTaskAtIndex:", but this does not remove the mzdownloadModel in the MZDownloadManager's downloadingArray.

Please help. thank you

ifamirhasan commented 7 years ago

You can use that : self.downloadManager.cancelTaskAtIndex(indexPath.row)

xtreme8210 commented 7 years ago

Hi, I have tried [self.downloadManager cancelTaskAtIndex:selectedIndexPath.row]; then reload datas [self.downloadingArray removeAllObjects]; self.downloadingArray = [[NSMutableArray alloc] initWithArray:(NSMutableArray *)self.downloadManager.downloadingArray];

I still get the data that I just deleted. Please help.

xtreme8210 commented 7 years ago

I found out, I should reload data in the delegate - (void)downloadRequestCanceled:(MZDownloadModel *)downloadModel index:(NSInteger)index;