“Could not find any information for class named ViewController”

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

    In case anyone is still frustrated by this, there's a trick to get things working.

    What I do is manually enter an outlet into my class, for example: @IBOutlet weak var someView: UIView!, and drag from the code to the view in IB or storyboard. After this, I am able to drag from IB / Storyboard to my class to make connections, assistant editors recognizes the class in "Automatic", etc...

    Works every time.

提交回复
热议问题