“Could not find any information for class named ViewController”

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

    Well in my case, the thing that worked (it's a litle weird, but worked) is the following:

    Try to add a datasource (ex. an extension to the ViewController like a UITableViewDataSource). Xcode will try to reload the ViewController. Then I wrote some method of the protocol (in the beginning Xcode did not autocomplete the methods, but wrote it out manually), then I added the IBOutlets, and then lastly, I removed the datasource.

    Example:

    class TestViewController:UIViewController{
        // This viewController presents “Could not find any information for  class named ViewController”
    }
    
    extension TestViewController:UITableViewDataSource{
        //Add Some methods of the protocol, Xcode will try to autocomplete and then it's going to reload the class, from then you can add your IBOulets / Actions .. And remove this extension if you don't need it otherwise.
    }
    

提交回复
热议问题