Context does not save the changes with error 1550

喜夏-厌秋 提交于 2019-12-01 20:59:00

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).

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?

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!