Re: NSURL problems on the Internet
Re: NSURL problems on the Internet
- Subject: Re: NSURL problems on the Internet
- From: Pierre-Olivier Latour <email@hidden>
- Date: Tue, 06 Aug 2002 23:26:08 +0200
>
I want to load images from the Internet; I used the advised pattern :
>
>
nsUrl = [NSURL URLWithString:theUrl];
>
data = [nsUrl resourceDataUsingCache:YES];
>
if (data) {
>
[data writeToFile:[destFile stringByExpandingTildeInPath]
>
atomically:YES];
>
} else {
>
// retry ?
>
>
The problem is, that the url manager seems to be weak : it regularly
>
fail (as if the image did not exist), and if I retry, it doesn't event
>
retry on the Internet, but keeps the preceeding result.
>
So it is impossible to get this image after that.
Did you try this?
data = [NSData initWithContentsOfURL:[NSURL URLWithString:theUrl]];
if(data)
[data writeToFile:[destFile stringByExpandingTildeInPath] atomically:YES];
else
??
Cocoa URL handling and downloading relies on CoreFoundation CFURL and
CFHTTP. However, these functions are not able to download correctly some
URLs on multi-domains apache servers. I filled a bug about it.
_____________________________________________________________
Pierre-Olivier Latour email@hidden
Lausanne, Switzerland
http://www.pol-online.net
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.