Re: Asynchronous downloading again
Re: Asynchronous downloading again
- Subject: Re: Asynchronous downloading again
- From: DKJ <email@hidden>
- Date: Sat, 31 Oct 2009 21:19:02 -0700
On 2009-10-31, at 19:34 , Roland King wrote:
. And why are you now talking about 4 NSURLConnections when you say
you have 2 files?
The 2-file example was a simplified case I posted when I was asking
whether the method would work. I actually have half-a-dozen or so data
files to download. (It can vary.)
I'm using the delegate to save the files to disk under different
names, so the delegate has to know which filename to use for which
connection. There's even a file that needs to be downloaded containing
the names of other files that need to be downloaded.
That's why I was doing things like this in the delegate (after the
initial received data was dealt with):
url = [NSURL URLWithString:[baseURL
stringByAppendingPathComponent:filename]];
dataString = [NSString stringWithContentsOfURL:url ...];
[dataString writeToFile:filename ...];
(I left out some parameters to make it easier to read.)
I'd be quite happy to do the whole thing synchronously: it's plenty
fast enough. But I wanted my little activity spinner to display, even
if it was only for a few seconds.
Any suggestions about how to do all of this with multiple
NSURLConnections would be quite welcome. Elegant code is a worthwhile
end in itself, even if there is no practical benefit in a particular
case.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden