Restoring context with NSURLSession background tasks
Restoring context with NSURLSession background tasks
- Subject: Restoring context with NSURLSession background tasks
- From: Rick Mann <email@hidden>
- Date: Fri, 21 Aug 2015 16:33:07 -0700
I'm finding the background task support to be lacking, in that there's a fair bit of context that's associated with my file downloads that I'm having to find a way to persist. I wonder if there's an easier way.
In my case, I'm writing an app that allows users to our 3D models offline. A model is comprised of thousands of small files. A request is made to get the catalog of files needed, and the response from that is a list of partial paths, and complete URLs for where to find each of the files.
The partial path tells me where the file needs to belong in the local hierarchy. Additional context includes where the local hierarchy is rooted (which is different for each model).
I need to get that context from the resulting delegate callback, and since I can get called after my app has died or been ejected, I have to be able to re-create that information from disk. Ideally, I could store a dictionary of serializable objects with the download task, and get that back from iOS in the callbacks. But what I'm doing is setting the taskDescription, and using that as a key into my own persisted data.
How do other people handle this?
TIA,
--
Rick Mann
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden