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

  • Home
  • SEARCH
  • 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 8216815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:15:44+00:00 2026-06-07T12:15:44+00:00

I see it’s apparently possible to submit apps without Lion installed , but my

  • 0

I see it’s apparently possible to submit apps without Lion installed, but my app downloads some large files, which need to be saved according to Apple storage guidelines.

Including the code below, I can’t even compile due to Use of undeclared identifier 'NSURLIsExcludedFromBackupKey':

-(BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL{
    if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"5.1")) {
        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;
    }
}

How can I keep using this code while I’ve only got iOS 5.0 SDK in xcode?

(or is my desire moot because I literally cannot tell my app it supports iOS 5.1?)

  • (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO comes from https://stackoverflow.com/a/5337804/194309)
  • 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-07T12:15:47+00:00Added an answer on June 7, 2026 at 12:15 pm

    I added a definition of that string constant if the ios version is not 5.1.

    Here is how my implementation looks like:

    + (BOOL)addSkipBackupAttributeToItemAtURL:(NSString*) path
        {           
            if (SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(@"5.01"))
            {
                const char* folderPath = [_privateDirectoryPath fileSystemRepresentation];
                u_int8_t attrValue = 1;
                int result = setxattr(folderPath, kMobileBackupAttrName, &attrValue, sizeof(attrValue), 0, 0);
                return result == 0;
            } 
            else
            {
        #ifndef __IPHONE_5_1
        #define NSURLIsExcludedFromBackupKey @"NSURLIsExcludedFromBackupKey"
        #endif
                NSError *error = nil;
                NSURL* url = [NSURL fileURLWithPath:path];
                ASSERT_CLASS(url, NSURL);
                BOOL success = [url setResourceValue: [NSNumber numberWithBool: YES]
                                              forKey: NSURLIsExcludedFromBackupKey 
                                               error: &error];
                //Assert success                
                return success;
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

See solution below, I would like some constructive feedback. what is the running time
See: http://jsbin.com/ebudec/edit#javascript,html It seems strange but I think jsBin doesn't recognize the jQuery document
See two examples how re.split() works: >>> re.split(',', 'a,b') ['a', 'b'] but >>> re.split('(,)',
See Diff 1.0 vs 2.0 . That one is solved, but it is still
See this screenshot of the On The Day app. At the bottom of the
See: Understanding Pointers In many C flavoured languages, and some older languages like Fortran,
See code below, for some reason it only works when I put a breakpoint
See this question . It turns out that even without committing the transaction manually,
See question. I can find documentation on the 5000 series and 7000 series but
See, I want the cp command on Android but it doesn't exist so I

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.