I\'m trying to update an entity and save the changes. I\'m getting always the following error:
The operation couldn’t be completed. (Cocoa error 1550.)
Explanation:
NSValidationErrorObject=<Event: 0x11024aa0> ...
This is the object that you trying to save and validation failed for it
NSValidationErrorKey=invitedUsers
This is the attribute (relationship) that failed validation
NSValidationErrorValue=Relationship 'invitedUsers' on managed object (0x11024aa0)
What failed validation. Everything else is the list of the users in the relationship...
I don't know your object model but for example the following seems to be wrong:
invitedToEvents = (
"0x110abbb0 <x-coredata://9F88714B-84EC-4E8F-9BC4-78E365A8FE0A/Event/p8>",
"0x166c0840 <x-coredata://9F88714B-84EC-4E8F-9BC4-78E365A8FE0A/Event/p8>",
"0x110abba0 <x-coredata://9F88714B-84EC-4E8F-9BC4-78E365A8FE0A/Event/p5>"
);
Note that one of the events is there twice (it has the same object id).
I ran into the 1550 error code as well. I had accidentally changed the data model and modified the destination of one of the relationships in an entity. Make sure to double check that the entity described by NSValidationErrorObject and the relationship described by NSValidationErrorKey are what you intend them to be.
Cocoa error 1550 means you are having a "dangling" pointer, more specifically a reference to a relationship that points to nowhere... I would assume you might be getting a nil back from one of the existinObjectWithID
methods?