From fcdb0b0d06a00fcd328eca6d3a187939525fabdc Mon Sep 17 00:00:00 2001 From: Christopher Meyer Date: Sun, 30 Mar 2014 22:12:42 +0200 Subject: [PATCH] newEntity moved to RHManagedObject+legacy.h --- RHManagedObject+legacy.h | 1 + RHManagedObject+legacy.m | 4 ++++ RHManagedObject.h | 1 - RHManagedObject.m | 4 ---- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/RHManagedObject+legacy.h b/RHManagedObject+legacy.h index a548b54..e0368c0 100644 --- a/RHManagedObject+legacy.h +++ b/RHManagedObject+legacy.h @@ -28,6 +28,7 @@ @interface RHManagedObject (legacy) +(NSEntityDescription *)entityDescription; ++(id)newEntity; +(id)newOrExistingEntityWithPredicate:(NSPredicate *)predicate; diff --git a/RHManagedObject+legacy.m b/RHManagedObject+legacy.m index 1a6ff8c..0ce8a1a 100644 --- a/RHManagedObject+legacy.m +++ b/RHManagedObject+legacy.m @@ -30,6 +30,10 @@ +(NSEntityDescription *)entityDescription { return [self entityDescriptionWithError:nil]; } ++(id)newEntity { + return [self newEntityWithError:nil]; +} + +(id)newOrExistingEntityWithPredicate:(NSPredicate *)predicate { return [self newOrExistingEntityWithPredicate:predicate error:nil]; } diff --git a/RHManagedObject.h b/RHManagedObject.h index dc10b99..a178449 100644 --- a/RHManagedObject.h +++ b/RHManagedObject.h @@ -50,7 +50,6 @@ typedef void (^RHDidDeleteBlock)(); +(NSError *)deleteStore; +(NSError *)commit; -+(id)newEntity; +(id)newEntityWithError:(NSError **)error; +(id)newOrExistingEntityWithPredicate:(NSPredicate *)predicate diff --git a/RHManagedObject.m b/RHManagedObject.m index d335ee5..c9bd4b6 100644 --- a/RHManagedObject.m +++ b/RHManagedObject.m @@ -74,10 +74,6 @@ +(NSError *)commit { return nil; } -+(id)newEntity { - return [self newEntityWithError:nil]; -} - +(id)newEntityWithError:(NSError **)error { return [NSEntityDescription insertNewObjectForEntityForName:[self entityName] inManagedObjectContext:[self managedObjectContextForCurrentThreadWithError:error]];