“Could not find any information for class named ViewController”

后端 未结 30 2025
南方客
南方客 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:27

    Stay On Target!

    I was adding a new class with a Xib and I started seeing this issue and I spent a goodly time looking through the answers on here and seeing if any of it made a difference to it.

    As it happens, I have multiple targets in my workspace and often I have to switch between them.

    Turns out adding new files will kick start a re-index in Xcode. But if you are pointing at the wrong target then the indexing is likely to meaningless and during the drag to connect Xcode will not be able to find your class.

    In short

    Step 1.

    Make sure you have the correct target set so that indexing makes sense.

提交回复
热议问题