The trouble? Since you must already have the NSURLRequests then you're talking about the difference between

        [ [ NSURLConnection alloc ] initWithRequest:request delegate:self ]

vs

        [ NSURLConnection sendSynchronousRequest:request returningResponse... ]

don't see the extra trouble here. And why are you now talking about 4 NSURLConnections when you say you have 2 files? Using the delegate method also means you can put all your error handling in one place instead of having to deal with failures on the first file in the delegate method and failures for the second file download in the code.

To know when al your files are downloaded you just need to keep track of which requests have finished.


On 01-Nov-2009, at 10:20 AM, DKJ wrote:

I'm still not getting this. Why go to the trouble of setting up four separate NSURLConnections when one will do the job? And at the same time give me a very simple way to know when all the data is in place?

If the files took a long time to download, I could see it. But these take less than 5 seconds, even with a completely synchronous download.

dkj

On 2009-10-31, at 19:01 , Kyle Sluder wrote:

On Sat, Oct 31, 2009 at 6:50 PM, DKJ <hatzicw...@shaw.ca> wrote:
I was worried that having a download connection for each file would make it
more complicated for the app to know when they were all finished.

Translation: "I don't know how to do it correctly, and therefore fear
it.  I want to stick to what I know."

You can overcome this fear; it's surprisingly easy to do.  All you
have to do is start writing the code, without concern that you're
doing it wrong.  Keep butting your head against it and eventually the
pattern will shine through.

This is a process with which I got very familiar while learning Cocoa.
The intricacy of correct usage is intimidating, but the only way to
overcome it is to try.

--Kyle Sluder

=====================
Hatzic Intellectual Software
Victoria BC, Canada
www.hatzicware.com





_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to