title: How to implement iOS Data Protection on iOS 8 app by XCode 6.1 project->targets->Capabilities->Data Protection?
body: <p>I found some legacy questions with dinosaur answers about implement Data Protection. I hear there are differents since iOS7 or iOS8. Do we still need coding after turn on the Data Protection capability in XCode 6? </p>
  
  <p>Is this necessary?  </p>
  
  <pre><code>[[NSFileManager defaultManager] createFileAtPath:[self filePath]
                                          contents:[@"super secret file contents" dataUsingEncoding:NSUTF8StringEncoding]
                                        attributes:[NSDictionary dictionaryWithObject:NSFileProtectionComplete
                                                                           forKey:NSFileProtectionKey]];
   [[[NSFileManager defaultManager] attributesOfItemAtPath:[self filePath]
                                                     error:NULL] 
                                               valueForKey:NSFileProtectionKey];
  </code></pre>
  
  <p>And, how can we protect Core Data with this Data Protection?</p>
  
  <p>OR, is this an one button solution for protect data in phone lock state? </p>