Hello,
I found this conversation because I was searching for the same error message (NSLocalizedFailureReason=Object graph corruption detected. Objects related to 'xxx' are assigned to multiple zones)
I tried to find the issue comparing intensively with the above liked project. In the end I was able to reproduce the issue with some small changes to it.
To reproduce the error, made the changes to FullImageView.swift (see attached). In essence, I
Copied in variables ratings and fetchRequest and their initialization from RatingView.swift.
Extended FullImageView.swift with two methods.
Built in a functions and buttons to easily add random ratings.
And added inline information on the photo share (CkShare) and the ratings into the view.
The following steps reliably reproduce the error for me
Start with a clean CloudKit container
Add a photo
Share the photo (the share is not accepted) - the photo is now in zone com.apple.coredata.cloudkit.share.XXX
Go to "Full Size Photo" view
Press either of the "ADD a random ratings" buttons
As a result a rating is added into the com.apple.coredata.cloudkit.zone and the error occurs (and derails the whole synchronization).
Working on a MacBook Air M2 with Sequoia 15.2, Xcode 16.2 and running this on an iPhone 12 (iOS 18.2.1) or on a simulator
Help would be highly appreciated. This is a very serious issue defeating the benefits of CloudKit. I cannot see from any documentation what the issue is.
Thanks!
FullImageView.swift.txt
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags: