iOS Data protection on core data not working
<p>I am trying to enable the data protection for my core data file. Here is what I did.</p>

<ol>
<li>Project settings enabled the data protection in capabilities.</li>
<li><p>Modified persistent store coordinator getter </p>

<pre><code>let coordinator = NSPersistentStoreCoordinator(managedObjectModel: self.managedObjectModel)
let url = self.applicationDocumentsDirectory.URLByAppendingPathComponent("SingleViewCoreData.sqlite")

var failureReason = "There was an error creating or loading the application's saved data."
do {
    try coordinator.addPersistentStoreWithType(NSSQLiteStoreType, configuration: nil, URL: url, options: [NSSQLitePragmasOption : ["journal_mode" : "DELETE"], NSPersistentStoreFileProtectionKey : NSFileProtectionComplete])
}
</code></pre></li>
<li><p>Ran the code and installed the app on the device. </p></li>
<li>Downloaded the app container and opened package content, and could see the .sqlite file</li>
<li>Now locked the device</li>
<li>Kept it for 10 sec, and then downloaded the app container again for the same app.
7.Opened the package content, I can still see the package content and sqlite file :(</li>
</ol>

<p>I am using free provisioning profile if that helps in anyway.</p>

<p>What mistake am I doing here?? Why is this .sqlite file is not encrypted? </p>

<p>Please help. Thanks in advance.</p>