6

I'm working on an app that uses NSPersistentCloudKitContainer to share data between devices. The core data model has multiple entities, two of which are connected using a relationship with it's respective inverse. The issue I'm having is that when I set the relationship to nil the cloud data is not updated and when I restart the app, the relationship gets reset back what it was before it was set to nil.

Is this a bug in the new NSPersistentCloudKitContainer? Is anyone else having this issue?

Jake
  • 13,097
  • 9
  • 44
  • 73
  • I just realised the issue now, core data seems to remove the relationship properly, but after a sync, the relationship will come back again! – Phuah Yee Keat Jan 01 '20 at 13:29
  • 1
    Did you manage to figure this out? I realised that even in the CloudKit Dashboard, there is no way to remove a field. If I set the string field to empty it will crash CoreData when it syncs down. Seems like the only way is to create my own dummy "nil" object for it to link to. – Phuah Yee Keat Jan 01 '20 at 14:21
  • Have the same issue: https://stackoverflow.com/questions/62000858/issue-with-optional-core-data-relationship-using-nspersistentcloudkitcontainer Just noticed yours now, I hope I might get some useful insight. Did you somehow work around this issue? – simonnickel May 25 '20 at 10:48

1 Answers1

0

iOS 14 seems to have fixed this issue for me.

Phuah Yee Keat
  • 1,572
  • 1
  • 17
  • 17