I renamed a class, which happened to have an outlet connection to a label called mainLabel in a storyboard file. When I run my program, it crashes and gives me the error: "this class is not key value coding-compliant for the key mainLabel".
Other SO answers have shown this to be caused by a bad outlet connection, so I removed the connection and removed any lose ends. When trying to reconnect the label to an outlet in my code, I get the error Could not insert new outlet connection: Could not find any information for the class named CourseTableViewCell
Other SO answers have provided solutions which I have tried and haven't worked including:
I made sure that the correct file name was listed in the identity inspector, under "Custom Class". If anybody has any other ideas, please let me know!
I can provide more information if necessary.
The following steps are what you need to do to find existing IBOutlet / IBAction from and object. Be it label
, button
, etc. And how to remove it.
Main.storyboard
. The Document outline window
should be visible by default on the left of your storyboard window. If not, click the icon on left of the storyboard window, next to the View As: iPhone 7
. storyboard
, it's easier to find and then select it from the document outline
of the storyboard
. Utility window
if not yet open on the most right side. Use shortcut key Cmd-Option-0
(command-option-zero), to toggle open/close of the utility window. right arrow
icon (top right most icon). Remove any unwanted IBOutlet / IBAction or any other connection you want to remove by clicking on the x
icon next to the connection. circle
next to the element
in the connection window
for a particular object
. Else add the connection the way you have been doing for now. As for the Class file and other coding file. You could just comment out the lines that previously have IBAction
or IBOutlet
. And retype the same line manually (don't cut and paste
). Add back the connection from storyboard
, and you should be good. Don't forget to delete the lines you commented out that you don't need anymore.