Context does not save the changes with error 1550

前端 未结 3 1878
别那么骄傲
别那么骄傲 2021-01-21 02:36

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


        
相关标签:
3条回答
  • 2021-01-21 03:26

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

    0 讨论(0)
  • 2021-01-21 03:29

    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.

    0 讨论(0)
  • 2021-01-21 03:32

    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?

    0 讨论(0)
提交回复
热议问题