MCCoreDataRepository

Undocumented

  • fetch all the objects by EntityName in the current thread

    Parameter

    Parameter entityName: Name of the corresponding entity

    Parameter

    Parameter context: ManagedObjectContext created in the current thread. If nil the call should be from the main Thread

    Parameter

    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 object

    Parameter

    Parameter entityName: Name of the corresponding entity

    Parameter

    Parameter context: ManagedObjectContext created in the current thread. If nil the call should be from the main Thread

    Parameter

    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 NSManagedObjectID

    Parameter

    Parameter completionBlock: Completion block

    Declaration

    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 NSManagedObjectID

    Parameter

    Parameter context: a specific NSManagedObjectContext

    Declaration

    Swift

    @objc public func delete(containedInArray array: [AnyObject], context: NSManagedObjectContext)

    Parameters

    array

    Specify an array of NSManagedObject or NSManagedObjectID

    context

    a specific NSManagedObjectContext