<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreData",
  "identifier" : "/documentation/CoreData/NSMergeConflict/init(source:newVersion:oldVersion:cachedSnapshot:persistedSnapshot:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Core Data"
    ],
    "preciseIdentifier" : "c:objc(cs)NSMergeConflict(im)initWithSource:newVersion:oldVersion:cachedSnapshot:persistedSnapshot:"
  },
  "title" : "init(source:newVersion:oldVersion:cachedSnapshot:persistedSnapshot:)"
}
-->

# init(source:newVersion:oldVersion:cachedSnapshot:persistedSnapshot:)

Initializes a merge conflict.

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

## 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.

## See Also

  [Core Data Model Versioning and Data Migration Programming Guide](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CoreDataVersioning/Articles/Introduction.html#//apple_ref/doc/uid/TP40004399)



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)