title: Deleting Specific Object From Core Data (Swift)
body: <p>In my Core Data Entity <code>Favorite</code>, I am appending Strings to its Attribute <code>fav</code>.</p>
  
  <p>When I look up a <code>fav</code> object based on String name and try to <b>delete</b> it, it is not deleting the entry, but instead is setting that object's <code>fav = nil</code></p>
  
  <p>Here is my code:</p>
  
  <pre><code>let managedContext = (UIApplication.sharedApplication().delegate as! AppDelegate).managedObjectContext!
  let favoriteFetchRequest = NSFetchRequest(entityName:"Favorite")
  
  let predicate = NSPredicate(format: "fav == %@", "snowboarding")
  
     favoriteFetchRequest.predicate = predicate
  
  let fetchedEntities = managedContext.executeFetchRequest(favoriteFetchRequest, error: nil) as! [NSManagedObject]
  
      for entity in fetchedEntities {
         managedContext.deleteObject(entity)
  
         if !managedContext.save(&amp;error) {
            println("Could not save \(error)")
         }
      }
  </code></pre>
  
  <p>When I rerun the app and have all Entity data display, the log shows:</p>
  
  <pre><code>&lt;NSManagedObject: 0x7fc8b0d1e4f0&gt; (entity: Favorite; id: 0xd000000000080000 &lt;x-coredata://8984EF48-71AF-4B87-AA59-EE5999038369/Favorite/p2&gt; ; data: {
  fav = nil;})
  </code></pre>
  
  <p>This is turn creates a whole bunch of <code>nil</code> entries and the Core Data is never empty (as I'd like it to be at times). What am I doing wrong? How do I delete the entire object?</p>