Mac Developer Library

Developer

CoreData Framework Reference NSMergeConflict Class Reference

Options
Deployment Target:

On This Page
Language:

NSMergeConflict

A merge conflict encapsulates conflicts that occur when attempting to save changes in a managed object context. More...

Inheritance


Conforms To


Import Statement


import CoreData @import CoreData;

Availability


Available in OS X v10.7 and later.
  • Initializes a merge conflict.

    Declaration

    Swift

    init(source srcObject: NSManagedObject, newVersion newvers: Int, oldVersion oldvers: Int, cachedSnapshot cachesnap: [NSObject : AnyObject], persistedSnapshot persnap: [NSObject : AnyObject]?)

    Objective-C

    - (instancetype)initWithSource:(NSManagedObject *)srcObject newVersion:(NSUInteger)newvers oldVersion:(NSUInteger)oldvers cachedSnapshot:(NSDictionary *)cachesnap persistedSnapshot:(NSDictionary *)persnap

    Parameters

    srcObject

    The source object for the conflict.

    newvers

    The new version number for the change.

    A value of 0 means the object was deleted and the corresponding snapshot is nil.

    oldvers

    The old version number for the change.

    cachesnap

    A dictionary containing the values of srcObject held in the persistent store coordinator layer.

    persnap

    A dictionary containing the values of srcObject held in the persistent store.

    Return Value

    A merge conflict object initialized with the given parameters.

    Import Statement

    import CoreData

    Availability

    Available in OS X v10.7 and later.

  • The source object for the conflict. (read-only)

    Declaration

    Swift

    var sourceObject: NSManagedObject { get }

    Objective-C

    @property(readonly, retain) NSManagedObject *sourceObject

    Import Statement

    import CoreData

    Availability

    Available in OS X v10.7 and later.

  • A dictionary containing the values of the source object. (read-only)

    Declaration

    Swift

    var objectSnapshot: [NSObject : AnyObject]? { get }

    Objective-C

    @property(readonly, retain) NSDictionary *objectSnapshot

    Import Statement

    import CoreData

    Availability

    Available in OS X v10.7 and later.

  • A dictionary containing the values of the source object held in the persistent store coordinator layer. (read-only)

    Declaration

    Swift

    var cachedSnapshot: [NSObject : AnyObject] { get }

    Objective-C

    @property(readonly, retain) NSDictionary *cachedSnapshot

    Import Statement

    import CoreData

    Availability

    Available in OS X v10.7 and later.

  • A dictionary containing the values of the source object held in the persistent store. (read-only)

    Declaration

    Swift

    var persistedSnapshot: [NSObject : AnyObject]? { get }

    Objective-C

    @property(readonly, retain) NSDictionary *persistedSnapshot

    Import Statement

    import CoreData

    Availability

    Available in OS X v10.7 and later.

  • The new version number for the change. (read-only)

    Declaration

    Swift

    var newVersionNumber: Int { get }

    Objective-C

    @property(readonly) NSUInteger newVersionNumber

    Discussion

    A new version number of 0 means the object was deleted and the corresponding snapshot is nil.

    Import Statement

    import CoreData

    Availability

    Available in OS X v10.7 and later.

  • The old version number for the change. (read-only)

    Declaration

    Swift

    var oldVersionNumber: Int { get }

    Objective-C

    @property(readonly) NSUInteger oldVersionNumber

    Import Statement

    import CoreData

    Availability

    Available in OS X v10.7 and later.