Re: how should I go about downloading files
Re: how should I go about downloading files
- Subject: Re: how should I go about downloading files
- From: John Stiles <email@hidden>
- Date: Mon, 14 Apr 2008 13:25:10 -0700
Laimonas Simutis wrote:
On Fri, Apr 11, 2008 at 6:01 PM, Scott Anguish <email@hidden> wrote:
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..
NSOperation* classes look like what I could definitely use, but the
docs mention that NSOperation and
NSOperationQueue are available for MacOSX 10.5 and above. I am
developing on 10.4. And the question arose here, when the
documentation states that a class is available for 10.5 and later does
that mean that if I use this class my app is compatible only with mac
osx 10.5 and later or does that mean that to take advantage of this
class I must run 10.5 but once compiled it will run in previous
versions of mac OS?
If you use NSOperation/NSOperationQueue, your app will require 10.5.
(And you'd need to be developing on 10.5 to even access them.)
You can usually do the same sorts of things with NSThread, it will just
not be as easy to do.
_______________________________________________
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