Mac Assigning NSManagedObject to NSPersistentStore

Hello,

I have a iOS app I was looking at porting to Mac.

I'm having an issue with both the Mac (Designed for iPad) and Mac Catalyst Destinations. I can't test Mac due to too many build issues.

I'm trying to assign a new NSManagedObject into a NSPersistentStore.

let object = MyObject(context: context)
context.assign(object, to: nsPersistentStore)

This works fine for iOS/iOS Simulator/iPhone/iPad. But on the Mac it's crashing with

FAULT: NSInvalidArgumentException: Can't assign an object to a store that does not contain the object's entity.; {
Thread 1: "Can't assign an object to a store that does not contain the object's entity."
Mac Assigning NSManagedObject to NSPersistentStore
 
 
Q