Re: progress bar when creating file
Re: progress bar when creating file
- Subject: Re: progress bar when creating file
- From: David Chan <email@hidden>
- Date: Tue, 8 Nov 2005 12:04:21 +0800
Thanks joar for the reply.
I have tried the NSURLConnection.
Now I realise there is another problem preceeding the progress indicator thingy.
As it is, my application is supposed to read a text file containing a
list of URLs that contain the data I need to download.
Using my previous approach, the loop will not reiiterate until the
first item in the list is completely downloaded, and so on. So at most
I can only download one item at one time.
This is not preferable as I would like to allow the user to determine
how many item they are allowed to download at the same time (let say 2
items).
Upon using the NSURLConnection approach apparently I could somehow
concurrently download multiple items at the same time.
Problem being, the object that was used for the first item was also
used for the second item and somehow it just mix up and my application
would exit with signal 11 (SIGSEGV) whenever I have more than 1 item
in the list.
Is there someway I could use NSURLConnection delegate to allow
multiple item download and to control the max no. of items to be
downloaded at one time?
Thanks..
On 11/7/05, j o a r <email@hidden> wrote:
>
> On 7 nov 2005, at 11.53, David Chan wrote:
>
> > I am sorry if this is an elementary issue but I am really clueless
> > with
> > regards to the following matter. I would like to create a progress
> > bar that
> > shows the progress of my 'file downloading process'.
> > By 'file downloading process' i mean the below process:
> > NSURL *theURL= [NSURL URLWithString: theString];
> > NSData *theData= [NSData dataWithContentsOfURL: theURL]; (1)
> > [fileManager createFileAtPath: theLocalPath contents: theData
> > attributes:
> > nil]; (2)
> > I suspect code on the line (1) and or (2) might be the one which
> > relate to
> > the progress bar but I am not sure which and how to relate it.
> > Please enlighten me on this matter. THanks a lot.
>
> You need to use the more capable NSURLConnection / NSURLDownload
> classes to get hold of that type of functionality:
>
> <http://developer.apple.com/documentation/Cocoa/Conceptual/
> URLLoadingSystem/Tasks/UsingNSURLConnection.html#//apple_ref/doc/uid/
> 20001836-170129>
>
> I'm not sure if it would work for local file URLs though. I've only
> used it for HTTP.
>
> 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