Is there a way to exclude some of the files in your application bundle from being backed up to the user's computer? I have a photo browsing application that allows you to store photos/videos locally, when a user goes sync their device and the application is backed up its taking a really long time since its backing up all the locally stored photos/videos as well. Is there perhaps a directory (/tmp/?) that won't be backed up?
Yes you must put files that you don't want to backup to Caches directory. Path can be obtained:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
NSString *cachesPath = [paths objectAtIndex:0];
iOS Applocation Programming Guide: A Few Important Application Directories talks about which folders are backed up and which aren't. You should use <Application_Home>/Library/Caches
to store persistent data that does not need to be backed up.
iPhone Application Programming Guide: Getting Paths to Application Directories shows how to get the path to that folder by using NSSearchPathForDirectoriesInDomains
with NSCachesDirectory
parameter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With