Sorix / CloudCore

Framework that enables syncing between iCloud (CloudKit) and Core Data
MIT License
153 stars 40 forks source link

Error in fetchAndSave(using userInfo:, container:, error:, completion:) #8

Closed philipladendorf closed 6 years ago

philipladendorf commented 7 years ago

Hey,

I stumbled upon an error that probably occurs during the transformation from iCloud to CoreData. It happens during the initial fetchAndSave call during application start.

Error Message: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unacceptable type of value for ordered to-many relationship: property = "transactions"; desired type = NSOrderedSet; given type = NSArrayM; value = ( "<CKReference: 0x1c002d560; recordID=<CKRecordID: 0x1c0229200; recordName=3606B38D-FB8F-49FC-B77C-5FC419B56BDA, zoneID=CloudCore:defaultOwner__>>" ).'

I have a Type - Entity, which has a to-many relationship to a Transaction - Entity, called transactions. It seems to get an array value from fetchAndSave but is expecting an NSSet. I changed the value to an NSOrderedSet in CoreData, but it didn't help.

Any idea what could cause this error ?

Sorix commented 6 years ago

I think I fixed that error, you may check it in 1.0.1 version.