user2771609
user2771609

Reputation: 1903

EXC_BAD_ACCESS error when using an NSURLSession NSURLSessionDownloadTask on some hardware in iOS 9

UPDATE

Works in iOS9 Beta 5

ORIGINAL QUESTION

Executing this line of code causes an EXC_BAD_ACCESS error to happen shortly after in some library code on a non-main thread before the completion handler is called.

[[[NSURLSession sharedSession]  downloadTaskWithURL:[NSURL URLWithString: @"https://www.google.com/images/srpr/logo11w.png"]
                                  completionHandler:^(NSURL *location,
                                                      NSURLResponse *response,
                                                      NSError *error) {
                                      NSLog(@"At Download Completion Handler");   
                                  }] resume];

It happens on my iPad model A1403 on iOS 9 Beta 3 and 4, but not on iOS8.1, and works fine on my iPad model A1566 on both iOS 9 and iOS 8.4.

I've logged a bug with Apple.

Is anyone else having this issue? Does anyone see a workaround?

Tests:

  1. iOS 8.1 - device A1566 - working
  2. iOS 8.4 - device A1403 - working
  3. iOS 9 beta 4 - simulator - working
  4. iOS 9 beta 4 - device A1566 - working
  5. iOS 9 beta 3 - device A1403 - NOT WORKING
  6. iOS 9 beta 4 - device A1403 - NOT WORKING

Testing by Tander:

  1. iOS 8.3 - device - working
  2. iOS 9 beta 0 - simulator - working
  3. iOS 9 beta 4 - device - working

So the problem is really only occurring on device A1403 with iOS 9...

Upvotes: 2

Views: 596

Answers (1)

Robert J. Clegg
Robert J. Clegg

Reputation: 7360

So I have tested this bit of code for you on the following versions of iOS: 8,3 (device) 9.0 (Simulator) and 9.4 (Device) - the completionHandler always executes and the log is printed out on all test devices. Not a bug it would seem. Are you testing on an actual device(s) ?

Upvotes: 1

Related Questions