IBOutlet not recognized in new target

210 views Asked by At

I have recently added a new target to my XCode swift iOS application project, all works fine apart from one UIViewController from the storyboard. When I reach it during the flow of my application, I get the following crash, which doesn't occur when running against the original target.

2017-01-08 11:47:22.714 SmoothCam Free[1179:269737] Unknown class _TtC6SmoothCam3PicReviewViewController in Interface Builder file.
2017-01-08 11:47:22.834 SmoothCam Free[1179:269737] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x1576f610> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key altitudeKey.'

I have checked that the class PicReviewViewController is building for both targets. In the main storyboard file, I have checked that the IBOutlet link for this "altitudeKey" Label is looking OK:

enter image description here

Does anyone know what could be causing this, and why I only get this problem with the new target?

1

There are 1 answers

0
tishu On BEST ANSWER

That was it. For this particular custom ViewController, in IB under the Custom Class in the identity inspector the first module was set. I blanked that and now it shows "Current Module - Module name" in grey and works for both targets. Thanks both!