CSAsynchronousDataTransaction

@objc
public final class CSAsynchronousDataTransaction : CSBaseDataTransaction, CoreStoreObjectiveCType

The CSAsynchronousDataTransaction serves as the Objective-C bridging type for AsynchronousDataTransaction.

  • Saves the transaction changes. This method should not be used after the -commitWithCompletion: method was already called once.

    Declaration

    Swift

    @objc
    public func commitWithSuccess(_ success: (() -> Void)?, failure: ((CSError) -> Void)?)

    Parameters

    success

    the block executed if the save succeeds.

    failure

    the block executed if the save fails. A CSError is reported as the argument of the block.

  • Creates a new NSManagedObject with the specified entity type.

    Declaration

    Swift

    @objc
    public override func createInto(_ into: CSInto) -> Any

    Parameters

    into

    the CSInto clause indicating the destination NSManagedObject entity type and the destination configuration

    Return Value

    a new NSManagedObject instance of the specified entity type.

  • Returns an editable proxy of a specified NSManagedObject. This method should not be used after the -commitWithCompletion: method was already called once.

    Declaration

    Swift

    @objc
    public override func editObject(_ object: NSManagedObject?) -> Any?

    Parameters

    object

    the NSManagedObject type to be edited

    Return Value

    an editable proxy for the specified NSManagedObject.

  • Returns an editable proxy of the object with the specified NSManagedObjectID. This method should not be used after the -commitWithCompletion: method was already called once.

    Declaration

    Swift

    @objc
    public override func editInto(_ into: CSInto, objectID: NSManagedObjectID) -> Any?

    Parameters

    into

    a CSInto clause specifying the entity type

    objectID

    the NSManagedObjectID for the object to be edited

    Return Value

    an editable proxy for the specified NSManagedObject.

  • Deletes a specified NSManagedObject. This method should not be used after the -commitWithCompletion: method was already called once.

    Declaration

    Swift

    @objc
    public override func deleteObject(_ object: NSManagedObject?)

    Parameters

    object

    the NSManagedObject type to be deleted

  • Deletes the specified NSManagedObjects.

    Declaration

    Swift

    @objc
    public override func deleteObjects(_ objects: [NSManagedObject])

    Parameters

    objects

    the NSManagedObjects type to be deleted