ios9on-demand-resources

Can iOS 9 on-demand resources be kept permanently?


According to the documentation, iOS 9 on-demand resources downloaded through a NSBundleResourceRequest are kept only until endAccessingResources is called, and it is called automatically when the resource request object is deallocated.

Okay, but when the app terminates, everything is deallocated. So does this mean that resources downloaded using a NSBundleResourceRequest don't survive termination of the app? I was hoping to use a simple strategy of making my app smaller for download from the App Store by not including a lot of the resources, and then downloading them later; but that's not going to work if I'm not able to keep those resources. Am I expected to copy the resources somewhere else and release the NSBundleResourceRequest?


Solution

  • I ended up doing exactly what the question suggests in its last sentence: when the resources arrive, I copy them into the Application Support folder and release the NSBundleResourceRequest.

    This seems somewhat against the spirit of on-demand resources, but in my opinion that spirit is the wrong spirit; this feature is not designed in a very practical way.