title: NSPredicate syntax to exclude a given NSManagedObject
body: <p>I have a Core Data store in which many of the entities should be unique instances of their particular NSEntityDescription. I'm currently doing this by creating a new entity for a given description, then this:</p>
  
  <pre><code>-(void)clearMyManagedObjectsExceptFor:(NSManagedObject*)except {
  
      NSArray *managedObjects = [ self fetchMyManagedObjectsWithPredicateOrNil: nil ];
      // returns all managed objects for a given NSEntityDescription
  
      NSManagedObject *managedObject;
      for( NSUInteger i = 0; i &lt; [ managedObjects count ]; i++ ){
          managedObject = [ managedObjects objectAtIndex: i ];
          if( ![ managedObject isEqual: except ] ){
              [ managedObjectContext deleteObject: managedObject ];
          }
      }
  }
  </code></pre>
  
  <p>Which works, but it feels like I should be able to do that != with an NSPredicate rather than in the iteration, but I just can't figure out the right predicate syntax to do it. Can anyone enlighten me?</p>