callback/callback-ios — pull request #8 by buddydvd (2011-11-01 07:42:50+00:00)
Title: Load sound from remote URL with NSURLConnection

Instead of downloading sound with `NSData`'s `dataWithContentsOfURL:`, use `NSURLConnection`'s `sendSynchronousRequest:returningResponse:error:` instead.

1. `NSData`'s `dataWithContentsOfURL:` does not check to see if the request's response is already stored `NSURLCache`'s shared cache. `NSURLConnection`'s `sendSynchronousRequest:returningResponse:error:`, on the other hand, does. This change allows applications to load sounds directly from the cache instead of downloading them repeatedly.

2. Also, this change reveals network errors that happened during download instead of hiding them.