I have the following method of saving file data with more than one option. I want to combine NSDataWritingAtomic with NSDataWritingFileProtectionComplete. Should I use the | symbol to combine two options when writing NSData?
The reason why I'm asking is that NSDataWritingFileProtectionComplete should not really work if the device has no passcode set, but I'm not seeing any difference, so I need to make sure I set the options correctly.
-(void)saveFileData:(NSData*)data
{
NSError* error = nil;
BOOL success = [data writeToFile:[self filepath] options:NSDataWritingAtomic|NSDataWritingFileProtectionComplete error:&error];
if(success == NO || error != nil)
{
DLog(@"Error encrypting data file");
}
}