Question

I'm using NSURLSession together with NSURLSessionDataTasks to manage background data fetching in my app. I am intermittently seeing EXC_BAD_ACCESS crashes on a background thread with the following stack trace:

Looking deeper reveals that the dispatch_group_notify_f is trying to retain nil.

What could be happening in my code to cause this?

Was it helpful?

Solution

I was not able to solve this problem except by not calling invalidateAndCancel and instead just waiting for the tasks to complete in the event of an error. I'm sure that further investigation could have found a way to prevent this, but working around it was easier.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top