---
title: "init(source:newVersion:oldVersion:cachedSnapshot:persistedSnapshot:)"
framework: coredata
role: symbol
role_heading: Initializer
path: "coredata/nsmergeconflict/init(source:newversion:oldversion:cachedsnapshot:persistedsnapshot:)"
---

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

Initializes a merge conflict.

## Declaration

```swift
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

Return Value A merge conflict object initialized with the given parameters.

## See Also

### Related Documentation

- [Core Data Model Versioning and Data Migration Programming Guide](apple-archive/documentation/Cocoa/Conceptual/CoreDataVersioning/Articles/Introduction.html.md)
