2

When I run my app and test a view controller with a table view, the following error is created:

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UITableViewCell 0x7ff068023b30> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key albumImageView.'

I created this cell by duplicating another UITableViewCell xib file and view controller and making the necessary modifications. I tried deleting and recreating all outlet connections with the new view controller. The Custom Class is correctly entered for the table view cell.

Would appreciate if anyone has advice on how to fix this error.

enter image description here

David
  • 155
  • 1
  • 10
  • 1
    You haven't set the right cell class somewhere; Note that the exception refers to `UITableviewCell`, not `MixTableviewCell` – Paulw11 Apr 08 '21 at 07:21
  • 1
    @Paulw11 very good point. I just realized the issue was that the Module wasn't automatically "Inherited from target" under the xib's filled in custom class after duplicating the file. – David Apr 08 '21 at 07:34

1 Answers1

7

The issue was fixed by checking "Inherit Module From Target" in the Custom Class section.

David
  • 155
  • 1
  • 10