NSURL problems on the Internet
NSURL problems on the Internet
- Subject: NSURL problems on the Internet
- From: Raff <email@hidden>
- Date: Tue, 6 Aug 2002 22:40:08 +0200
Hi,
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.
On the contrary, indicating the same URL on Internet Explorer make the
image load.
is there an URL cache in the Cocoa framework ? where is the problem ?
By the way, if I want to download several images, is it advised to use a
pool of thread, or is it sufficiently optimized in the framework ?
(Note that this increases the problem above, as if multiple network
activity prevent from getting the Url to 'work' (small TTL ?).
Thanks for your help
R.D.
_______________________________________________
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.