Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8520719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:36:34+00:00 2026-06-11T06:36:34+00:00

I have file – of arbitrary type including Core Data repositories – that I

  • 0

I have file – of arbitrary type including Core Data repositories – that I need to keep around and not have iOS delete them. Usually, I do not want iCloud to back these files up. Where should I save them?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T06:36:36+00:00Added an answer on June 11, 2026 at 6:36 am

    Saving files locally changed from iOS5.0 and earlier, 5.0.1, and 5.1 and newer primarily to the address iCloud backup issues. There are two Apple source documents (the File System Programming Guide, and QA1719) that together provide the information supporting the following:

    • iOS 5.0

    Files should be saved in the “Caches” directory, as there is no way to prevent backups if they are stored in the Documents folder. Note that the system may remove these files (see QA1719), so you would need the ability to recreate each as needed. To find the caches directory, use this:

    [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject]
    
    • iOS 5.0.1

    Files should be saved in ‘/Library/Application Support’ (FSP, page 15), which can be better accessed via:

    [NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) lastObject]
    

    My experience is that this directory doesn’t always exist, and thus you may need to create it:

    - (NSString *)applicationAppSupportDirectory
    {
        return [NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) lastObject];
    }
    
    NSFileManager *manager = [NSFileManager defaultManager];
    NSString *appSupportDir = [self applicationAppSupportDirectory];
    if(![manager fileExistsAtPath:appSupportDir]) {
        __autoreleasing NSError *error;
        BOOL ret = [manager createDirectoryAtPath:appSupportDir withIntermediateDirectories:NO attributes:nil error:&error];
        if(!ret) {
            NSLog(@"ERROR app support: %@", error);
            exit(0);
        }
    }
    

    Files saved to this directory (or subdirectories) need an extended attribute to tell iCloud not to back them up (see QA1719).

    PS: I have not found a way to set the Deployment target to this release, if there is a way please leave a comment.

    • iOS 5.1

    Files (or folders of files) should be located in the ‘Application Support’ folder as described above. To prevent iCloud from backing up use:

    [URL setResourceValue: [NSNumber numberWithBool: YES] forKey:NSURLIsExcludedFromBackupKey error:&error]
    

    as described in QA1719. Note that you can apply this key to a directory to prevent its contents from being backed up. The complete method from QA1719:

    - (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL
    {
        assert([[NSFileManager defaultManager] fileExistsAtPath: [URL path]]);
    
        NSError *error = nil;
        BOOL success = [URL setResourceValue: [NSNumber numberWithBool: YES]
                                      forKey: NSURLIsExcludedFromBackupKey error: &error];
        if(!success){
            NSLog(@"Error excluding %@ from backup %@", [URL lastPathComponent], error);
        }
        return success;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have file with bitarray that looks like this: 10000000000000000000000000000000000000000000000000000000000000000000001000000 I need to make
I have file that I need to hash, this file can be too large
I have file names that are in this format: anytext_NUMBER_svm.pkl I need to loop
I have a html file with some variable arrays that I need to increment.
Suppose that we have file like this: sometext11 sometext12 sometext13 sometext21 sometext22 sometext23 Texts
In the web page, I have file upload widget. I need to show this
have file data of format 3.343445 1 3.54564 1 4.345535 1 2.453454 1 and
I have file that contains: # sdfdsfds fsf var1=1232 #fdsfdsfds #fdsfsdf var2=456 .................. I
I have file names that end in yyyymmdd, eg: myFile.20090601, myFile20090708 , etc I
I have file in the form of binary array and i need the browser

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.