Can anyone explain me how to cancel and retry an NKAssetDownload?
Currently I tried this:
NKAssetDownload * download = [issue.downloadingAssets objectAtIndex:0];
currentConnection = [download downloadWithDelegate:self];
To cancel the download I do:
[currentConnection cancel];
This works, however the NKAssetDownload stays in the NKIssue downloadingAssets table. Next time I want to download the same issue I execute the same code again ( downloadWithDelegate ). However this doesn't do anything. It is as if the NKAssetDownload instance still uses the same NSURLConnection that I previously canceled so it doesn't launch the download. The real problem is that I cannot remove the NKAssetDownload from the NKIssue and therefore cannot create a new one pointing at the same URL to retry the download. As far as I can tell there is no way of canceling a download and retrying it later, other than deleting the NKIssue from the library (which throws away everything) and recreating it. Does anyone know how to do this?
There is a related question on S.O. Is it possible to cancel an NKAssetDownload? but the only solution provided there is to delete the NKIssue, and that is not what I want to do.