How does [NSData dataWithContentsOfURL:]
deal with 302 redirects?
I am requesting an MP3 file from a server by passing the URL of a PHP page which will check the user-agent and redirect to the MP3 file on a different server.
Never use [NSData dataWithContentsOfURL:]
in a real app. It makes a synchronous network connection and your app will be killed by the OS if that doesn't finish quickly enough.
Stick to NSURLConnectionDataDelegate
or use [NSURLConnection sendAsynchronousRequest:queue:completionHandler:
.