Re: timeout on -[NSData dataWithContentsOfURL:] ?
Re: timeout on -[NSData dataWithContentsOfURL:] ?
- Subject: Re: timeout on -[NSData dataWithContentsOfURL:] ?
- From: j o a r <email@hidden>
- Date: Thu, 12 Jan 2006 08:00:45 +0100
On 12 jan 2006, at 07.15, email@hidden wrote:
Sometimes - and I haven't been able to pin it down 100% - all that
will eventually display is a pure white blank image. When this
happens, it happens for many images at once. It seems to happen
most often when my home network is congested or I am trying to load
so many of these images that they take a long time.
Is there a timeout on -dataWithContentsOfURL? What gets returned at
that point?
Regardless of what data gets returned, I write it out and move on.
When I go back and read one of these "blank" images using -
dataWithContentsOfFile, I get a valid object, but the data it
contains is zero bytes.
Use NSURLConnection / NSURLDownload instead. They give you a lot more
control over the download, and better feedback for when things go
wrong. They are also offer an asynchronous mode, which is almost
certainly of advantage to you.
You should probably also consider setting up some sort of queue, so
that you don't open too many connections all at once. For performance
reasons, and to avoid annoying Flickr, it's probably best to restrict
your downloads to a handful at a time.
j o a r
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden