Saving to file, other improvements #3

Open
wants to merge 12 commits into
from

Conversation

Projects
None yet
1 participant
@atomicbird

I've added a few features and made some improvements to ZSURLConnectionDelegate:

  • Incoming data is saved to a file instead of being held in memory. If filePath has been set then it is used, otherwise a temporary file is created and later cleaned up.
  • File writes are done asynchronously on a GCD queue while the network connection is still running.
  • Self-signed certificates can now be accepted either from all hosts or from a specific list of hosts.
  • Can be initialized with an NSURLRequest instead of an NSURL, so that request headers can be set (old initializers are still present).
  • New convenience initializers.
  • Optional userInfo property.

This also changes the asset manager demo app, fixing memory issues and getting it to load photos found in the RSS feed and display thumbnails in the table view.

atomicbird added some commits May 17, 2011

Your puny ObjC memory management is no match for the call to xmlFreeD…
…oc() in GDataXMLDocument's dealloc. With the result that releasing "document" in -feedDownloadSuccessful: means that there's no more data for the table view to display by the time it tries to look through its items.
Add the option to init with an NSURLRequest so the caller has the opt…
…ion to set headers and POST body. Add support for self-signed HTTPS certificates. Add userInfo parameter.
Sane-ify use of the writeQueue. Writes are now dispatched asynchronou…
…sly while the network connection loads, and a dispatch group is used to ensure all writes finish.
Replace dispatch_group_wait with dispatch_group_notify to avoid block…
…ing while waiting for file writes to finish on another queue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment