3

I'm using iOS 5.1 I use this peace of code

[pathURL setResourceValue:[NSNumber numberWithBool:YES]
                   forKey:NSURLIsExcludedFromBackupKey
                    error:nil];

The folder where I put my content is (inside app sandbox) .../Library/Application Support/, not a /Documents folder

I do not receive any errors and the result of setResourceValue: is YES

Why do I see 2 MB is Settings -> iCloud -> ... etc. where I can check the apps data size?

Tunaki
  • 132,869
  • 46
  • 340
  • 423
Dmitry Pilipenko
  • 339
  • 6
  • 16

2 Answers2

3

Finally I found the solution by myself The clue is to apply NSURLIsExcludedFromBackupKey to root folder not to every file you want to exclude from backup

so at very beginning you should call this with (for example) "Library/Application Support" folder

Dmitry Pilipenko
  • 339
  • 6
  • 16
0

It's worth to note that you can't just set the flag on NSHomeDirectory(). It has to be internal to that path.

keehun
  • 41
  • 4