Application rejected due to "do not back up" reason
I tried one thing to remove this issue. I got one small code from Apple technical support and used this code in my project according to iOS guideLines. First, I added a header file in my appdelegate.m
part
#import<sys/xattr.h>
Then paste the below function.
- (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;
}
And call the above function to my appdelegate when it finishes launching.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
[self addSkipBackupAttributeToItemAtURL:[NSURL URLWithString:@"<Application_Home>/Library/Caches"]];
[self addSkipBackupAttributeToItemAtURL:[NSURL URLWithString:@"<Application_Home>/tmp"]];
[self addSkipBackupAttributeToItemAtURL:[NSURL URLWithString:@"<Application_Home>/Library/Private Documents"]];
}
Now I just want to know if this OK or not. Can I reupload my application on iTunes Connect or not?