Posted in iOS, Swift

iOS, Swift | UI connection between storyboard and .swift source issue

Environment

Xcode Version 9.0.1

 

Symptom


Error occurs whenever control-drag to connect ui and source from storyboard to .swift file like the screenshot.

Terminating app due to uncaught exception ‘NSUnknownKeyException’, reason: ‘[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key

Resolution


Try control-drag from an UI image in storyboard to a source code like the above image.

And then build and run an application.

After this, the both ways works.

1st – control-drag from a title of an UI in storyboard to a source file.

2nd – control-drag from an UI image in story board to a source file.

I don’t understand why. But it works for me.

 

Advertisements

Author:

HOiT Creator

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s