0

Got a bit of a quandary which attaches to the following code

        var returnCell = PlanetDataCell()
        if let dequeuedCell = collectionView.dequeueReusableCell(withReuseIdentifier: "PlanetDataCell", for: indexPath) as? PlanetDataCell {
            returnCell = dequeuedCell
        }

I have a project/target this works in. I duplicated the target and in the duplicate target this throws an exception. While there is now code change between the two targets around LaunchScreen and Main. This code is buried fairly deeply and has not been touched at all between the two versions.

[<UICollectionViewCell 0x7fab4637c370> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key moreInfoButton.

The PlanetDataCell is defined in storyboard not in a separate xib or by code. As pictured below.

I've tried cleaning the build folder (on both targets) disconnecting the action for the button that connects to moreInfoButton: and reconnecting it. I have also blown away DerivedData and that changed nothing.

Cell design and composition moreInfo Button connections

Dru Freeman
  • 1,766
  • 3
  • 19
  • 41

1 Answers1

1

It turns out that the module was being automatically assigned to the original target. I had to trigger a rarely used setting (for me) in IB where the Module is inherited from the target. Pictured below.

enter image description here

Dru Freeman
  • 1,766
  • 3
  • 19
  • 41