The Apple retention rule method method poses more problems for me, because most of the data that I support from the Documents directory (files, dataBase and some material related to the application). I recently uploaded a binary file to the application store and it provided me with a report
according to this point. I am going to change my code as below
- (NSString *)applicationDocumentsDirectory { NSString *documentPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]; NSURL *pathURL= [NSURL fileURLWithPath:documentPath]; [self addSkipBackupAttributeToItemAtURL:pathURL]; return documentPath; } - (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL { const char* filePath = [[URL path] fileSystemRepresentation]; const char* attrName = "com.apple.MobileBackup"; u_int8_t attrValue = 1; int result = setxattr(filePath, attrName, &attrValue, sizeof(attrValue), 0, 0); return result == 0; }
MY QUESTIONS:
1. I can use the addSkipBackupAttributeToItemAtURL: method directly in the document directory to strip the iCloud backup for all my files in the document directory.
2. This code is sufficient to approve my application in the application store if my last binary code is rejected due to the attribute βdo not back upβ, which is not included in the directory of my documents.
source share