Version: 1.3

Posted: 2006-01-18

Build Requirements: Xcode

Runtime Requirements: Mac OS X Mac OS X 10.1

View Source Code:

Download Sample (“CFNetworkHTTPDownload.zip”, 37.4K)
Download Sample (“CFNetworkHTTPDownload.dmg”, 99.6K)



Description

CFNetworkHTTPDownload is a Carbon Nib based Mach-O application which demonstrates how to use CFNetworking to download a url.

Builds as a Universal Binary

Document Revision History

Date Notes
2006-01-18Updated to produce a universal binary. No code changes were required.
2005-08-10Normalized URL. This properly modifies the passed in URL to replace spaces with %20, etc. before downloading. Show how to set the User-Agent Increased the size of the buffer containing the URL from 256 bytes to 8K.
2004-10-01The stram was being closed improperly and therefore leaking system resources. Added calls to CFReadStreamUnscheduleFromRunLoop, and CFReadStreamClose to properly close the read stream.
2003-08-20Demonstrates how to download a URL using CFNetworking.

Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.