2

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...

user2771609
  • 1,867
  • 1
  • 15
  • 36

1 Answers1

1

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) ?

Robert J. Clegg
  • 7,231
  • 9
  • 47
  • 99
  • 1
    Interesting. I have two devices, an iPad 3rd gen (A1403) running IOS 9 beta 4, and an iPad Air 2 (A1555) running IOS 8.1. I have the problem only on the iPad 3rd gen. I just tested on the simulator and it works on IOS 9 beta 4. So it seems like it is hardware related? – user2771609 Jul 23 '15 at 20:09
  • 1
    Very possible its hardware related. Maybe do a soft reset on the device. I'll run it on an iPad and see what the results are and update here once I have done that. Interested to see if its not device related. Will get back to you tomorrow. – Robert J. Clegg Jul 23 '15 at 20:28
  • Soft reset did not help. BUT, I downgraded to iOS 8.4 on the device where I was having trouble (A1403), and it __does__ work. So it seems like A1403 + iOS 9 is the problem... – user2771609 Jul 23 '15 at 21:00
  • 1
    I upgraded my A1566 iPad to iOS 9 beta 4, and it works. So really the only time it does not work is A1403 iPad + iOS 9, so definitely hardware specific. – user2771609 Jul 23 '15 at 23:46
  • 1
    So I tested it on my iPad 2 (A1396) iOS9.4 and my iPhone 5s (A1530) 9,4 Beta and a test device iPhone 6 (A1549) iOS 8.3. and all works just fine. So it is hardware related. I wonder if it is specific to your device though? I wish I had an A1403 iPad to try out... – Robert J. Clegg Jul 24 '15 at 07:31
  • 1
    Thanks for the extensive testing. It would be really nice to have another A1403 to test this on. – user2771609 Jul 24 '15 at 16:59
  • 1
    I might have access to one on Monday. If I do, I'll test and get back to you. Interested to see if its related to just your device or all A1403's. – Robert J. Clegg Jul 24 '15 at 17:05
  • Awesome. That would be great to know. – user2771609 Jul 24 '15 at 17:11
  • I've tested on another A1403, and I can reproduce the bug. @Tander, were you able to get your hands on an A1403? – user2771609 Jul 31 '15 at 03:52
  • @user2771609 - I only have an iPad Mini 2 to test against. Though it seems this bug is related to A1403 devices. If you'd like I'll test against the iPad Mini 2 ? – Robert J. Clegg Jul 31 '15 at 07:13
  • If you can't get your hand on an A1403, then don't worry about it. It seems like an A1403 + iOS 9 bug. I'll try to work with Apple to get them to fix it. Thanks for your help! – user2771609 Jul 31 '15 at 16:13
  • @user2771609 Interestingly enough I have a bug too. on iPad 2 + iOS9 B4 my app crashes - not in my own code either. Same iPad + iOS8 no issues. On iPad Mini 2 + iOS9 no problems. Would be interesting to see what Apple find. Keep us updated – Robert J. Clegg Jul 31 '15 at 17:04
  • Ha! What is the model number of your iPad 2? – user2771609 Jul 31 '15 at 17:12
  • Its a A1396 - 3G + WiFi – Robert J. Clegg Aug 01 '15 at 15:02