NSManagedObject(CYCoreData) Category Reference
| Declared in | NSManagedObject+CYCoreData.h NSManagedObject+CYCoreData.m |
Tasks
Config
Write
-
+ entityName -
+ newObjectInContext: -
+ updateOrCreateObjectInContext:withDictionary: -
+ deleteAllObjectsInContext: -
+ deleteObjectsInContext:sortedBy:withPredicate: -
– updateWithDictionary: -
– setBoolValuesInDictionary:forKeys: -
– setIntValuesInDictionary:forKeys: -
– setIntegerValuesInDictionary:forKeys: -
– setFloatValuesInDictionary:forKeys: -
– setDoubleValuesInDictionary:forKeys: -
– setDateValuesInDictionary:forKeys: -
– setUnixDateValuesInDictionary:forKeys: -
– setMicrosecondDateValuesInDictionary:forKeys: -
– setStringValuesInDictionary:forKeys: -
– setKeyValue:fromKey:inDictionary:forManagedObjectValueType:
Read
-
+ fetchObjectsInContext:sortedBy:withPredicate: -
+ fetchCountInContext:withPredicate: -
+ fetchFirstObjectInContext:sortedBy:withPredicate: -
+ fetchAllInContext: -
+ fetchObjectsInContext:byPageNumber:withObjectsPerPage:withSortDescriptors: -
+ fetchObjectsInContext:byPageNumber:withObjectsPerPage:andPredicate:withSortDescriptors:
Class Methods
configureModelUniqueIdentifier:ofDataType:withJSONSearchString:
Sets the keys for and type of unique indexer for NSManagedObjects. This key is used to fetch unique NSEntity in the database.
+ (void)configureModelUniqueIdentifier:(NSString *)uniquePropertyKey ofDataType:(UniqueObjectValueType)uniqueObjectValueType withJSONSearchString:(NSString *)jsonSearchPropertyKeyParameters
- uniquePropertyKey
NSStringfor the unique property key if the NSManagedObject; example @“uid”
- uniqueObjectValueType
UniqueObjectValueType type of value the uniquePropertyKey is
- jsonSearchPropertyKey
NSStringthe key the unique property will have on a JSON of for that object
Discussion
Warning: If called, must call before [CYCoreData liason].
Declared In
NSManagedObject+CYCoreData.hconfigureUniqueIdentifier:
Utility method for configureModelUniqueIdentifier:ofDataType:withJSONSearchString:
+ (void)configureUniqueIdentifier:(UniqueIdentiferStruct)uniqueIdentiferStructParameters
- `UniqueIdentiferStruct`
Predefined struct of the values passesd to
configureModelUniqueIdentifier:ofDataType:withJSONSearchString:
Discussion
Warning: If called, must call before [CYCoreData liason].
Declared In
NSManagedObject+CYCoreData.hdeleteAllObjectsInContext:
Deletes all NSEntityDescription of NSManagedObject subclass that calls it from the NSManagedObjectContext passed.
+ (void)deleteAllObjectsInContext:(NSManagedObjectContext *)contextParameters
- context
NSManagedObjectContextto delete theNSManagedObjectsubclass from
Declared In
NSManagedObject+CYCoreData.hdeleteObjectsInContext:sortedBy:withPredicate:
Deletes specifically fetched NSEntityDescription of NSManagedObject with NSSortDescriptors and NSPredicate of subclass that calls it from the NSManagedObjectContext passed.
+ (void)deleteObjectsInContext:(NSManagedObjectContext *)context sortedBy:(NSArray *)sortDescriptors withPredicate:(NSPredicate *)predicateParameters
- context
NSManagedObjectContextto delete theNSManagedObjectsubclass from
- sortDescriptors
NSArrayof NSSortDescriptors to order against
- predicate
NSPredicateto search against
Declared In
NSManagedObject+CYCoreData.hentityName
Returns a NSString value of to identitify the class of the NSManagedObject
+ (NSString *)entityNameReturn Value
NSStringto identify class name
Declared In
NSManagedObject+CYCoreData.hfetchAllInContext:
Returns all NSManagedObjects of subclass that call it from the NSManagedObjectContext passed.
+ (NSArray *)fetchAllInContext:(NSManagedObjectContext *)contextParameters
- context
NSManagedObjectContextthe context to fetch from
Return Value
NSArray of NSManagedObject subclasses from the NSManagedObjectContext passed.
Declared In
NSManagedObject+CYCoreData.hfetchCountInContext:withPredicate:
Returns an NSUInteger identitifying the number of NSManagedObject subclasses in the NSManagedObjectContext passed with NSPredicate.
+ (NSUInteger)fetchCountInContext:(NSManagedObjectContext *)context withPredicate:(NSPredicate *)predicateParameters
- context
NSManagedObjectContextto fetch from
- predicate
NSPredicateto search against
Return Value
NSUInteger identitifying the number of NSManagedObject subclasses in the NSManagedObjectContext passed with NSPredicate
Declared In
NSManagedObject+CYCoreData.hfetchFirstObjectInContext:sortedBy:withPredicate:
Returns first NSManagedObject subclasses with NSSortDescriptors and NSPredicate of subclass that calls it from the NSManagedObjectContext passed.
+ (instancetype)fetchFirstObjectInContext:(NSManagedObjectContext *)context sortedBy:(NSArray *)sortDescriptors withPredicate:(NSPredicate *)predicateParameters
- context
NSManagedObjectContextto fetch from
- sortDescriptors
NSArray of NSSortDescriptors to order against
- predicate
NSPredicateto search against
Return Value
instancetype NSManagedObject subclass returned from an NSFetchRequest with NSSortDescriptors and NSPredicate from the NSManagedObjectContext passed
Declared In
NSManagedObject+CYCoreData.hfetchObjectsInContext:byPageNumber:withObjectsPerPage:andPredicate:withSortDescriptors:
Fetches NSEntityDescription of NSManagedObject subclasses with NSSortDescriptors and NSPredicate of subclass that calls it from the NSManagedObjectContext passed. The resulting array is paginated by the perPage and the give page pageNumber is returned
+ (NSArray *)fetchObjectsInContext:(NSManagedObjectContext *)context byPageNumber:(NSInteger)pageNumber withObjectsPerPage:(NSInteger)perPage andPredicate:(NSPredicate *)predicate withSortDescriptors:(NSArray *)sortDescriptorsParameters
- context
NSManagedObjectContextto fetch from
- pageNumber
NSIntegerthe page number to return
- perPage
NSIntegerthe amount ofNSManagedObjectsubclasses per page
- predicate
NSPredicateto search against
- sortDescriptors
NSArrayofNSSortDescriptorsto order against
Return Value
NSArray of NSManagedObject subclasses from the NSManagedObjectContext passed, queried by NSSortDescriptors and NSPredicate of pageNumber when paginated by perPage
Declared In
NSManagedObject+CYCoreData.hfetchObjectsInContext:byPageNumber:withObjectsPerPage:withSortDescriptors:
Fetches NSEntityDescription of NSManagedObject subclasses with NSSortDescriptors of subclass that calls it from the NSManagedObjectContext passed. The resulting array is paginated by the perPage and the give page pageNumber is returned
+ (NSArray *)fetchObjectsInContext:(NSManagedObjectContext *)context byPageNumber:(NSInteger)pageNumber withObjectsPerPage:(NSInteger)perPage withSortDescriptors:(NSArray *)sortDescriptorsParameters
- context
NSManagedObjectContextto fetch from
- pageNumber
NSIntegerthe page number to return
- perPage
NSIntegerthe amount ofNSManagedObjectsubclasses per page
- sortDescriptors
NSArray ofNSSortDescriptors to order against
Return Value
NSArray of NSManagedObject subclasses from the NSManagedObjectContext passed, queried by sortDescriptors of pageNumber when paginated by perPage
Declared In
NSManagedObject+CYCoreData.hfetchObjectsInContext:sortedBy:withPredicate:
Returns specifically fetched NSEntityDescriptions of NSManagedObject with sortDescriptors and NSPredicate of subclass that calls it from the NSManagedObjectContext passed.
+ (NSArray *)fetchObjectsInContext:(NSManagedObjectContext *)context sortedBy:(NSArray *)sortDescriptors withPredicate:(NSPredicate *)predicateParameters
- context
NSManagedObjectContextto fetch theNSManagedObjectsubclass from
- sortDescriptors
NSArrayofNSSortDescriptorsto order against
- predicate
NSPredicateto search against
Return Value
NSArray of NSManagedObject subclasses that satisfy the NSSortDescriptors and NSPredicate
Declared In
NSManagedObject+CYCoreData.hnewObjectInContext:
Creates and returns an NSManagedObject from the subclass that calls via the NSManagedObjectContext passed.
+ (instancetype)newObjectInContext:(NSManagedObjectContext *)contextParameters
- context
NSManagedObjectContextthe context theNSManagedObjectsubclass will be inserted from
Return Value
instancetype NSManagedObject subclass from the subclass that calls it.
Declared In
NSManagedObject+CYCoreData.hupdateOrCreateObjectInContext:withDictionary:
Creates and returns an NSManagedObject from the subclass that calls via the NSManagedObjectContext passed. The NSDictionary passed will be parsed and key value mapped to the new created NSManagedObject subclass.
+ (instancetype)updateOrCreateObjectInContext:(NSManagedObjectContext *)context withDictionary:(NSDictionary *)dictionaryParameters
- context
NSManagedObjectContextthe context theNSManagedObjectsubclass will be inserted from
- dictionary
NSDictionary that will be parsed and key value mapped to the new created
NSManagedObjectsubclass
Return Value
instancetype NSManagedObject subclass from the subclass that calls it.
Declared In
NSManagedObject+CYCoreData.hInstance Methods
setBoolValuesInDictionary:forKeys:
The NSDictionary will be searched by NSString keys in NSArray. If found, BOOL values will be applied to NSManagedObject subclass that called it.
- (void)setBoolValuesInDictionary:(NSDictionary *)dictionary forKeys:(NSString *)first, ...Parameters
- dictionary
NSDictionary that will be parsed and key value mapped to the new created
NSManagedObjectsubclass
- keys
NSArrayofNSStringkeys forBOOLsin the theNSDictionary
Discussion
Warning: Insert keys as iOS paradigm camelCase. Method automatically changes iOS paradigm camelCase to JSON paradigm to under_score key
Declared In
NSManagedObject+CYCoreData.hsetDateValuesInDictionary:forKeys:
The NSDictionary will be searched by NSString keys in NSArray. If found, timestamp string values will be applied to NSManagedObject subclass that called it.
- (void)setDateValuesInDictionary:(NSDictionary *)dictionary forKeys:(NSString *)first, ...Parameters
- dictionary
NSDictionarythat will be parsed and key value mapped to the new createdNSManagedObjectsubclass
- keys
NSArrayofNSStringkeys forTimestampsin the theNSDictionary
Discussion
Warning: Insert keys as iOS paradigm camelCase. Method automatically changes iOS paradigm camelCase to JSON paradigm to under_score key
Declared In
NSManagedObject+CYCoreData.hsetDoubleValuesInDictionary:forKeys:
The NSDictionary will be searched by NSString keys in NSArray. If found, double values will be applied to NSManagedObject subclass that called it.
- (void)setDoubleValuesInDictionary:(NSDictionary *)dictionary forKeys:(NSString *)first, ...Parameters
- dictionary
NSDictionarythat will be parsed and key value mapped to the new createdNSManagedObjectsubclass
- keys
NSArrayofNSStringkeys fordoublesin the theNSDictionary
Discussion
Warning: Insert keys as iOS paradigm camelCase. Method automatically changes iOS paradigm camelCase to JSON paradigm to under_score key
Declared In
NSManagedObject+CYCoreData.hsetFloatValuesInDictionary:forKeys:
The NSDictionary will be searched by NSString keys in NSArray. If found, float values will be applied to NSManagedObject subclass that called it.
- (void)setFloatValuesInDictionary:(NSDictionary *)dictionary forKeys:(NSString *)first, ...Parameters
- dictionary
NSDictionarythat will be parsed and key value mapped to the new createdNSManagedObjectsubclass
- keys
NSArrayofNSStringkeys forfloatsin the theNSDictionary
Discussion
Warning: Insert keys as iOS paradigm camelCase. Method automatically changes iOS paradigm camelCase to JSON paradigm to under_score key
Declared In
NSManagedObject+CYCoreData.hsetIntValuesInDictionary:forKeys:
The NSDictionary will be searched by NSString keys in NSArray. If found, int values will be applied to NSManagedObject subclass that called it.
- (void)setIntValuesInDictionary:(NSDictionary *)dictionary forKeys:(NSString *)first, ...Parameters
- dictionary
NSDictionarythat will be parsed and key value mapped to the new createdNSManagedObjectsubclass
- keys
NSArrayofNSStringkeys forintsin the theNSDictionary
Discussion
Warning: Insert keys as iOS paradigm camelCase. Method automatically changes iOS paradigm camelCase to JSON paradigm to under_score key
Declared In
NSManagedObject+CYCoreData.hsetIntegerValuesInDictionary:forKeys:
The NSDictionary will be searched by NSString keys in NSArray. If found, NSInteger values will be applied to NSManagedObject subclass that called it.
- (void)setIntegerValuesInDictionary:(NSDictionary *)dictionary forKeys:(NSString *)first, ...Parameters
- dictionary
NSDictionarythat will be parsed and key value mapped to the new createdNSManagedObjectsubclass
- keys
NSArrayofNSStringkeys forNSIntegersin the theNSDictionary
Discussion
Warning: Insert keys as iOS paradigm camelCase. Method automatically changes iOS paradigm camelCase to JSON paradigm to under_score key
Declared In
NSManagedObject+CYCoreData.hsetKeyValue:fromKey:inDictionary:forManagedObjectValueType:
dictionary will be searched for keyValue of object value type. If found, the property will be saved.
- (void)setKeyValue:(NSString *)keyValue fromKey:(NSString *)key inDictionary:(NSDictionary *)dictionary forManagedObjectValueType:(UniqueObjectValueType)typeParameters
- keyValue
NSStringvalue of theNSManagedObjectself
- key
NSStringvalue to search thedictionaryfor
- dictionary
NSDictionaryto search
- type
UniqueObjectValueTypeobject value type of theNSManagedObjectproperty
Declared In
NSManagedObject+CYCoreData.hsetMicrosecondDateValuesInDictionary:forKeys:
The NSDictionary will be searched by NSString keys in NSArray. If found, doubleValue string values will be applied to NSManagedObject subclass that called it.
- (void)setMicrosecondDateValuesInDictionary:(NSDictionary *)dictionary forKeys:(NSString *)first, ...Parameters
- dictionary
NSDictionarythat will be parsed and key value mapped to the new createdNSManagedObjectsubclass
- keys
NSArrayofNSStringkeys forTimestampsin microseconds in the theNSDictionary
Discussion
Warning: Insert keys as iOS paradigm camelCase. Method automatically changes iOS paradigm camelCase to JSON paradigm to under_score key
Declared In
NSManagedObject+CYCoreData.hsetStringValuesInDictionary:forKeys:
The NSDictionary will be searched by NSString keys in NSArray. If found, NSString values will be applied to NSManagedObject subclass that called it.
- (void)setStringValuesInDictionary:(NSDictionary *)dictionary forKeys:(NSString *)first, ...Parameters
- dictionary
NSDictionarythat will be parsed and key value mapped to the new createdNSManagedObjectsubclass
- keys
NSArrayofNSStringkeys forNSStringsin the theNSDictionary
Discussion
Warning: Insert keys as iOS paradigm camelCase. Method automatically changes iOS paradigm camelCase to JSON paradigm to under_score key
Declared In
NSManagedObject+CYCoreData.hsetUnixDateValuesInDictionary:forKeys:
The NSDictionary will be searched by NSString keys in NSArray. If found, int string values will be applied to NSManagedObject subclass that called it.
- (void)setUnixDateValuesInDictionary:(NSDictionary *)dictionary forKeys:(NSString *)first, ...Parameters
- dictionary
NSDictionarythat will be parsed and key value mapped to the new createdNSManagedObjectsubclass
- keys
NSArrayofNSStringkeys forUnix Timestampsin the theNSDictionary
Discussion
Warning: Insert keys as iOS paradigm camelCase. Method automatically changes iOS paradigm camelCase to JSON paradigm to under_score key
Declared In
NSManagedObject+CYCoreData.hupdateWithDictionary:
The NSDictionary passed will be parsed and key value mapped to NSManagedObject the subclass.
- (void)updateWithDictionary:(NSDictionary *)dictionaryParameters
- dictionary
NSDictionarythat will be parsed and key value mapped to the new createdNSManagedObjectsubclass
Declared In
NSManagedObject+CYCoreData.h