Search code examples
iosxcodeswiftxcode6-beta6

Unknown class in Interface builder error after renaming UIViewController class


I am stumped by this problem. I've searched and tried all of the other solutions regarding this error.

Unknown class _TtC4Addr24difficultyViewController in Interface Builder file.

The original name of the class it's trying to find is "difficultyViewController", but I renamed it to "HomeViewController" in the code and I am now getting this error. The view in the storyboard is pointing to the correct class (HomeViewController), yet I am still receiving this error. Does anybody know how to fix this problem?


Solution

  • A few things helped me solve this problem.

    1. First thing I did was "Clean" the project: Product -> Clean.
    2. Next, I was receiving an error that "Main.storyboard" could not be found. Upon inspecting Main.storyboard in my project, I found that the file had no target membership. I selected the project as the target membership and everything suddenly started working.