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
entityName
Name of the corresponding entity
context
ManagedObjectContext created in the current thread. If nil the call should be from the main Thread
resultType
this 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
predicate
NSPredicate object
entityName
Name of the corresponding entity
context
ManagedObjectContext created in the current thread. If nil the call should be from the main Thread
resultType
this 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
array
Specify an array of NSManagedObject or NSManagedObjectID
completionBlock
Completion 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
array
Specify an array of NSManagedObject or NSManagedObjectID
context
a specific NSManagedObjectContext