Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Downloading Files In Cocoa: Part 2

Downloading Files In Cocoa: Part 2
Thread Tools
Posting Junkie
Join Date: May 2001
Location: Portland, OR
Status: Offline
Reply With Quote
Jul 17, 2002, 06:54 PM
 
OK, earlier I posted on downloading files in Cocoa. I got that working (putting NSUrl into a NSData and saving it), but I ran into a problem. For technical reasons the download needs to be streaming, meaning the file is written as data is recieved. My current setup does not do this.

Any pointers or ideas on how to accomplish this?
8 Core 2.8 ghz Mac Pro/GF8800/2 23" Cinema Displays, 3.06 ghz Macbook Pro
Once you wanted revolution, now you're the institution, how's it feel to be the man?
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jul 18, 2002, 12:45 PM
 
I think NSURLHandle is what you want.
     
goMac  (op)
Posting Junkie
Join Date: May 2001
Location: Portland, OR
Status: Offline
Reply With Quote
Jul 18, 2002, 02:48 PM
 
</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">quote:</font><hr /><font size="1" face="Geneva, Verdana, Arial, sans-serif">Originally posted by Angus_D:
<strong>I think NSURLHandle is what you want.</strong></font><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">If I'm radint the documentation correctly, it doesn't provide me any advantages over the NSData method. I want to writ ethe data as its being recieved. It still looks like, with NSURLhandle, that I most load the data into the NSURLHandle all at once then write it.

Is this correct?
8 Core 2.8 ghz Mac Pro/GF8800/2 23" Cinema Displays, 3.06 ghz Macbook Pro
Once you wanted revolution, now you're the institution, how's it feel to be the man?
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jul 19, 2002, 01:38 PM
 
You can set up a delegate type thing and tell the handle to -loadInBackground, or similar. Then you can use the partial data notification. I'm working from memory here, but I did something similar to fill a progressbar as a file downloaded.
     
goMac  (op)
Posting Junkie
Join Date: May 2001
Location: Portland, OR
Status: Offline
Reply With Quote
Jul 19, 2002, 02:12 PM
 
</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">quote:</font><hr /><font size="1" face="Geneva, Verdana, Arial, sans-serif">Originally posted by Angus_D:
<strong>You can set up a delegate type thing and tell the handle to -loadInBackground, or similar. Then you can use the partial data notification. I'm working from memory here, but I did something similar to fill a progressbar as a file downloaded.</strong></font><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">I don't suppose you could get me the code you used?

Reason I'm asking is because delegation is something I've NEVER done before.
8 Core 2.8 ghz Mac Pro/GF8800/2 23" Cinema Displays, 3.06 ghz Macbook Pro
Once you wanted revolution, now you're the institution, how's it feel to be the man?
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 10:04 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2