“Could not find any information for class named ViewController”

后端 未结 30 1819
南方客
南方客 2020-12-02 06:35

This bug has been driving me nuts since I started using Xcode (4.6.3). Whenever I try to link a Storyboard item to my code, I get the error:

Could not

相关标签:
30条回答
  • 2020-12-02 07:33

    I was getting a similar problem, "Could not find a class named..." and the cause was stupid on my part once I figured it out. Make sure you aren't dragging from the item to the interface - make sure it's being dragged to the class itself

    0 讨论(0)
  • 2020-12-02 07:34

    I tried everything and it didn't work, so for me what worked is:

    • Clean Build folder and project.
    • Open Projects (Window -> Projects)
    • Find your project on the list and delete the Derived Data
    • Close Xcode
    • Restart computer (without choosing to reopen windows that are open)
    • run Xcode
    • Work!

    All my view controllers were not being recognized, so deleting all files and re-adding was not an option as this is a big project.

    0 讨论(0)
  • 2020-12-02 07:35

    Just try to delete Derived Data for the project

    0 讨论(0)
  • 2020-12-02 07:36

    None of the steps above worked for me, but I think I may have discovered the issue. At least it is what worked for me, and it is not a bug in Xcode.

    When in the assistant editor look at the top of the window that has the code for your viewController. The third option from the right likely says "Manual", but it should say "Automatic". Once I changed this, the problem was resolved!

    0 讨论(0)
  • 2020-12-02 07:38

    the following steps works for me hope that works for you also

    1- You need to reopen you project after closing Xcode.

    2- Wait for indexing project files

    3- Check if it work or not

    4- If still not working follow step 5, if not happy for you :)

    5- Clean and Build your project target

    0 讨论(0)
  • 2020-12-02 07:38

    For me, the view I had specified a custom class for was failing to be compiled by interface builder. It was marked @IBDesignable.

    Removing @IBDesignable, and then adding my outlets, and then marking it as @IBDesignable resolved the issue in my case.

    0 讨论(0)
提交回复
热议问题