“[something copyWithZone:]: unrecognized selector sent to instance” when using Bindings / Core Data

前端 未结 8 1624
情深已故
情深已故 2020-12-28 13:49

(self asking and self-answering because I spent hours on the web looking for this, and most of the resources all say \"I solved it in the end\" without giving an explanation

8条回答
  •  隐瞒了意图╮
    2020-12-28 14:27

    I also had a similar problem and it came from calling a ProxyObject rather than the actual object from an array controller.

    For example:

    MYEntity *entity = EntityController.selection;
    NSString *property = entity.property;   // <--- causes the error
    

    but

    MYEntity *entity = EntityController.selectedObjects firstObject]; // <--- fixes the error
    NSString *property = entity.property;   
    

提交回复
热议问题