Ho visto un video WWDC 2010 su NSFileProtectionComplete e protegge i dati dell'app.NSFileProtectionComplete per app iOS 4.0
Ci sono degli esempi là fuori? Qualcuno ha un codice di esempio da condividere?
Ho visto un video WWDC 2010 su NSFileProtectionComplete e protegge i dati dell'app.NSFileProtectionComplete per app iOS 4.0
Ci sono degli esempi là fuori? Qualcuno ha un codice di esempio da condividere?
vedere la classe NSFileManager 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.
è fondamentalmente vault per i singoli file. È sufficiente passare la costante quando si impostano gli attributi del file.
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
.
Ehi, sono di fretta, quindi puoi spiegarmi che cosa fa NSFileProtetionKey sul file ?? – satheeshwaran
Se si imposta questo comportamento sul file di directory Documenti. È possibile accedere al file su IDevice Locked State? @TechZen – iTag
Devi essere attenti a questo. È un buon modo per spararti nel piede perché il sistema può rendere illeggibili i file nel momento in cui sceglie. – TechZen
Documentazione su questo, TechZen? – memmons