I have a requirement to download files in sequential order. Currently, I can do this while the application is in the foreground.
Below is the logic I used.
This logic works when the application is in the foreground, but as soon as the application starts to run in the background (crash) and we start the application again before the download is completed, all task states have been changed to resume, and they all load at the same time.
Is this the expected behavior or something that I am missing to order this in serial mode in the background?
Edit: I checked by creating a boot job one at a time. After completing the first task, create the next one inside setTaskDidCompleteBlock and so on. It completes only the first task, and after that the session crashed when the task was created inside setTaskDidCompleteBlock (this only happens when working in the background, for the priority of its work is excellent).
Here are my screenshots of the crash log:

and

Any help would be appreciated.
ios nsurlsession nsurlsessiondownloadtask afnetworking-2
Nikhil.T Aug 13 '15 at 16:32 2015-08-13 16:32
source share