On Apr 10, 2008, at 9:04 PM, Laimonas Simutis wrote:
Hey,

This is my first cocoa projects so I am kind of finding my way around
the framework. The question I have is maybe more related to the design
practices with cocoa.

I make a HTTP call to a server which gives me back a list of urls
pointing to mp3 files. For each url handling I created FileDownloader
class that inside uses NSURLDownload class to download the mp3 file.
All works fine but I have a problem with finding a solution for
"queuing" the downloads. I want to control how many files will be
downloaded concurrently (usually it will be one or two). However right
now what I have is basically this:

Have a look at NSOperation and NSOperationQueue in concert with NSURLDownload

this will allow you to do this, as well as change priorities, control how many downloads can occur at the same time, etc..

http://developer.apple.com/documentation/Cocoa/Reference/NSOperation_class/index.html#/ /apple_ref/doc/uid/TP40004591

http://developer.apple.com/documentation/Cocoa/Reference/NSOperationQueue_class/index.html#/ /apple_ref/doc/uid/TP40004592


_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to