NSManagedObject(ActiveRecord) Category Reference
| Declared in | NSManagedObject+ActiveRecord.h NSManagedObject+ActiveRecord.m |
Tasks
-
+ entityThe NSEntityDescription for the Subclass defaults to the subclass className, may be overridden -
+ fetchRequestReturns an initialized NSFetchRequest for the entity, with no predicate -
+ objectsWithFetchRequest:Fetches all objects from the persistent store identified by the fetchRequest
-
+ countOfObjectsWithFetchRequest:Retrieves the number of objects that would be retrieved by the fetchRequest, if executed
-
+ objectsWithFetchRequests:Fetches all objects from the persistent store via a set of fetch requests and returns all results in a single array.
-
+ objectWithFetchRequest:Fetches the first object identified by the fetch request. A limit of one will be applied to the fetch request before dispatching.
-
+ objectsWithPredicate:Fetches all objects from the persistent store by constructing a fetch request and applying the predicate supplied. A short-cut for doing filtered searches on the objects of this class under management.
-
+ objectWithPredicate:Fetches the first object matching a predicate from the persistent store. A fetch request will be constructed for you and a fetch limit of 1 will be applied.
-
+ allObjectsFetches all managed objects of this class from the persistent store as an array
-
+ count:Returns a count of all managed objects of this class in the persistent store. On error, will populate the error argument
-
+ countReturns a count of all managed objects of this class in the persistent store. Deprecated use the error form above
-
+ objectCreates a new managed object and inserts it into the managedObjectContext. -
– isNewReturns YES when an object has not been saved to the managed object context yet
-
+ findByPrimaryKey:Finds the instance of the receiver’s entity with the given value for the primary key attribute in the managed object context for the current thread.
-
+ findByPrimaryKey:inContext:Finds the instance of the receiver’s entity with the given value for the primary key attribute in the given managed object context.
Class Methods
allObjects
Fetches all managed objects of this class from the persistent store as an array
+ (NSArray *)allObjectsDeclared In
NSManagedObject+ActiveRecord.hcount
Returns a count of all managed objects of this class in the persistent store. Deprecated use the error form above
+ (NSUInteger)countDiscussion
@deprecated
Declared In
NSManagedObject+ActiveRecord.hcount:
Returns a count of all managed objects of this class in the persistent store. On error, will populate the error argument
+ (NSUInteger)count:(NSError **)errorDeclared In
NSManagedObject+ActiveRecord.hcountOfObjectsWithFetchRequest:
Retrieves the number of objects that would be retrieved by the fetchRequest, if executed
+ (NSUInteger)countOfObjectsWithFetchRequest:(NSFetchRequest *)fetchRequestDeclared In
NSManagedObject+ActiveRecord.hentity
The NSEntityDescription for the Subclass
defaults to the subclass className, may be overridden
+ (NSEntityDescription *)entityDeclared In
NSManagedObject+ActiveRecord.hfetchRequest
Returns an initialized NSFetchRequest for the entity, with no predicate
+ (NSFetchRequest *)fetchRequestDeclared In
NSManagedObject+ActiveRecord.hfindByPrimaryKey:
Finds the instance of the receiver’s entity with the given value for the primary key attribute in the managed object context for the current thread.
+ (id)findByPrimaryKey:(id)primaryKeyValueParameters
- primaryKeyValue
The value for the receiving entity’s primary key attribute.
Return Value
The object with the primary key attribute equal to the given value or nil.
Declared In
NSManagedObject+ActiveRecord.hfindByPrimaryKey:inContext:
Finds the instance of the receiver’s entity with the given value for the primary key attribute in the given managed object context.
+ (id)findByPrimaryKey:(id)primaryKeyValue inContext:(NSManagedObjectContext *)contextParameters
- primaryKeyValue
The value for the receiving entity’s primary key attribute.
- context
The managed object context to find the instance in.
Return Value
The object with the primary key attribute equal to the given value or nil.
Declared In
NSManagedObject+ActiveRecord.hobject
Creates a new managed object and inserts it into the managedObjectContext.
+ (id)objectDeclared In
NSManagedObject+ActiveRecord.hobjectWithFetchRequest:
Fetches the first object identified by the fetch request. A limit of one will be applied to the fetch request before dispatching.
+ (id)objectWithFetchRequest:(NSFetchRequest *)fetchRequestDeclared In
NSManagedObject+ActiveRecord.hobjectWithPredicate:
Fetches the first object matching a predicate from the persistent store. A fetch request will be constructed for you and a fetch limit of 1 will be applied.
+ (id)objectWithPredicate:(NSPredicate *)predicateDeclared In
NSManagedObject+ActiveRecord.hobjectsWithFetchRequest:
Fetches all objects from the persistent store identified by the fetchRequest
+ (NSArray *)objectsWithFetchRequest:(NSFetchRequest *)fetchRequestDeclared In
NSManagedObject+ActiveRecord.hobjectsWithFetchRequests:
Fetches all objects from the persistent store via a set of fetch requests and returns all results in a single array.
+ (NSArray *)objectsWithFetchRequests:(NSArray *)fetchRequestsDeclared In
NSManagedObject+ActiveRecord.hobjectsWithPredicate:
Fetches all objects from the persistent store by constructing a fetch request and applying the predicate supplied. A short-cut for doing filtered searches on the objects of this class under management.
+ (NSArray *)objectsWithPredicate:(NSPredicate *)predicateDeclared In
NSManagedObject+ActiveRecord.h