I saw a WWDC 2010 video about NSFileProtectionComplete and protecting app's data.
Are there any examples out there? Does any one have sample code to share?
See the NSFileManager class doc:
The file is stored in an encrypted format on disk and cannot be read from or written to while the device is locked or booting.
It's basically file vault for individual files. You just pass the constant when you set the file attributes.
To mark a file as protected, you must add an extended attribute to it. The Foundation framework includes two ways to add this attribute:
When writing the contents of an NSData object to disk using the writeToFile:options:error: method, include the NSDataWritingFileProtectionComplete option.
Use the setAttributes:ofItemAtPath:error: method of NSFileManager to add the NSFileProtectionKey attribute (with the NSFileProtectionComplete value) to an existing file
.
http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/StandardBehaviors/StandardBehaviors.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With