Re: timeout on -[NSData dataWithContentsOfURL:] ?
Re: timeout on -[NSData dataWithContentsOfURL:] ?
- Subject: Re: timeout on -[NSData dataWithContentsOfURL:] ?
- From: Blake Seely <email@hidden>
- Date: Wed, 11 Jan 2006 23:32:31 -0800
Thanks joar,
I definitely plan to implement this much more intelligently in the
future - right now it just uses the shotgun approach so I could get
going. I was confused by the zero-byte files and wanted to check to
see at what point that will start to happen.
-Blake
On Jan 11, 2006, at 11:00 PM, j o a r wrote:
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
_______________________________________________
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