MCCoreDataRepository
Undocumented
-
fetch all the objects by EntityName in the current thread
Parameter
Parameter entityName: Name of the corresponding entityParameter
Parameter context: ManagedObjectContext created in the current thread. If nil the call should be from the main ThreadParameter
Parameter resultType: this can be .ManagedObject .ManagedObjectID .Dictionary .Count- Return: New NSManagedObject or nil
Declaration
Swift
public func fetch(entityName: String, context: NSManagedObjectContext, resultType: NSFetchRequestResultType) -> [AnyObject]?Parameters
entityNameName of the corresponding entity
contextManagedObjectContext created in the current thread. If nil the call should be from the main Thread
resultTypethis can be .ManagedObject .ManagedObjectID .Dictionary .Count
-
fetch all the object of a specific entityName, by Predicate, in the current thread
Parameter
Parameter predicate: NSPredicate objectParameter
Parameter entityName: Name of the corresponding entityParameter
Parameter context: ManagedObjectContext created in the current thread. If nil the call should be from the main ThreadParameter
Parameter resultType: this can be .ManagedObject .ManagedObjectID .Dictionary .Count- Return: array of results
Declaration
Swift
public func fetch(byPredicate predicate: NSPredicate, entityName: String, context: NSManagedObjectContext, resultType: NSFetchRequestResultType) -> [AnyObject]?Parameters
predicateNSPredicate object
entityNameName of the corresponding entity
contextManagedObjectContext created in the current thread. If nil the call should be from the main Thread
resultTypethis can be .ManagedObject .ManagedObjectID .Dictionary .Count
-
Delete objects contained into the specified array in a background thread
Parameter
Parameter array: Specify an array of NSManagedObject or NSManagedObjectIDParameter
Parameter completionBlock: Completion blockDeclaration
Swift
@objc public func delete(containedInArray array: [AnyObject], completionBlock: (() -> Void)?)Parameters
arraySpecify an array of NSManagedObject or NSManagedObjectID
completionBlockCompletion block
-
Delete objects contained into the specified array in the current thread
Parameter
Parameter array: Specify an array of NSManagedObject or NSManagedObjectIDParameter
Parameter context: a specific NSManagedObjectContextDeclaration
Swift
@objc public func delete(containedInArray array: [AnyObject], context: NSManagedObjectContext)Parameters
arraySpecify an array of NSManagedObject or NSManagedObjectID
contexta specific NSManagedObjectContext
MCCoreDataRepository Extension Reference