EXC_BAD_ACCESS in NSURLConnection: how to debug?
- by baswell
I have an iPhone app that downloads URLs. (PDFs to display) Easy:
self.conn = [NSURLConnection connectionWithRequest:self.request delegate:self];
where self.conn is a retained property.
For specific URLs, this throws EXC_BAD_ACCESS. The URL is valid and is constructed in the same way as URLs that do work. (90% of URLs are fine)
These ones work:
http://www.airservicesaustralia.com/publications/current/ersa/FAC_YARG_11-Mar-2010.pdf
http://www.airservicesaustralia.com/publications/current/ersa/FAC_YARK_11-Mar-2010.pdf
These don't:
http://www.airservicesaustralia.com/publications/current/ersa/FAC_YAMK_11-Mar-2010.pdf
http://www.airservicesaustralia.com/publications/current/ersa/FAC_YATN_11-Mar-2010.pdf
Spot the difference? Yeah, me neither. Also no difference in response headers from the server for them. To clarify, the ones that work ALWAYS work, the ones that don't NEVER work. So not some random release/retain issue it seems.
For the ones that don't work, none of the methods in my delegate are ever called, it fails hard before that. And with no error message, just EXC_BAD_ACCESS.
Sooo.... Any way to debug what is going on inside NSURLConnection?