• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSURL problems on the Internet
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >NSURL problems on the Internet (From: Raff <email@hidden>)

  • Prev by Date: Re: UID <-> Login name <-> Full name
  • Next by Date: Re: UID <-> Login name <-> Full name
  • Previous by thread: NSURL problems on the Internet
  • Next by thread: Re: NSURL problems on the Internet
  • Index(es):
    • Date
    • Thread