سؤال

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?

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top