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

前端 未结 8 1700
情深已故
情深已故 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:29

    Thank you for this solution, it pointed me in the right direction. For those of you learning InterfaceBuilder I hope this additional information helps.

    It turns out while building a tutorial I had inadvertently Bound a Text field Cell - Text Cell to my ArrayController.ObjectValue.
    The real binding was supposed to happen at

    Table Column > Table Cell View > Static Text - Table View Cell

    That one was correct, but visually in the tree below it (for reasons I don't understand yet IB needs a Text Field Cell.) I had also bound:

    Table Column > Text Field Cell - Text Cell

    It was that second binding which trying to copy the whole object because the path was objectValue with no key, it was triggering this error.

    Probably a newbie mistake, but it meant walking through EVERY object and checking for bindings and I came across this one.

提交回复
热议问题