0

So till some point of time I used this:

[NSURLConnection sendAsynchronousRequest:request 
                                       queue:[NSOperationQueue mainQueue]
                           completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
...Some code here
}];

But then I realized that there is always one case when such approach crashes the app.

For example, try use code on slow internet connection and till the block is done try to enter background and then return to the app again. You'll see that it crashes with EXC_BAD_ACCESS

So is sendasynchrequest block so worthless? Or am I missing something when using it?

Thanks in advance!

Noobass
  • 1,974
  • 24
  • 26
  • Answers (in order): No, yes. Provide the crash log, traceback and the "Some code here". – zaph Sep 28 '13 at 13:13
  • Yes, `sendAsynchronousRequest` is pretty limited (e.g. no progress updates, no way to cancel, etc.). But I suspect the `EXC_BAD_ACCESS` is a result of how you're using it. – Rob Sep 28 '13 at 14:38

0 Answers0