I'm trying to download a file in my cocoa app as follows :
NSURLRequest *downloadRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:downloadURL]];
NSURLDownload *downloader = [[NSURLDownload alloc] initWithRequest:downloadRequest delegate:self];
where downloadURL
is something like "https://www.abcd.com/path/to/file/abc.zip"
But I keep getting the following NSError
in the (void)download:(NSURLDownload *)download didFailWithError:(NSError *)error
method :
Error Domain=NSURLErrorDomain Code=-3001 "The operation couldn’t be completed. (NSURLErrorDomain error -3001.)" UserInfo=0x618000060a80 {NSErrorFailingURLStringKey=https://www.abcd.com/path/to/file/abc.zip, NSUnderlyingError=0x618000242010 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error -3001.)", NSErrorFailingURLKey=https://www.abcd.com/path/to/file/abc.zip}
What am I doing wrong?
Thanks for your help!