“找不到名为ViewController的类的任何信息” [英] "Could not find any information for class named ViewController"

查看:225
本文介绍了“找不到名为ViewController的类的任何信息”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从我开始使用Xcode(4.6.3)以来,这个bug一直让我疯狂。每当我尝试将Storyboard项链接到我的代码时,我都会收到错误找不到名为ViewController的类的任何信息。这也发生在自定义类中。我已经尝试删除委托数据,我已经尝试删除并重新添加类,我已经尝试重新启动Xcode,我已经尝试重新安装Xcode。无论什么类,我都无法按住Ctrl键拖动以在任何项目中创建连接。全新的模板应用程序也会出现同样的问题。如果我手动输入代码然后按住Ctrl键拖动,我可以建立一个有效的连接,但是我无法自动添加它。到目前为止,我在互联网上找不到的任何东西都有帮助。任何指针?

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 find any information for class named ViewController." This happens with custom classes as well. I've tried deleting the delegate data, I've tried removing and re-adding the classes, I've tried restarting Xcode, I've tried reinstalling Xcode. I can't ctrl-drag to create connections in any of my projects no matter what the class. The same problem happens with a brand-new template application. If I type in the code manually and then ctrl-drag, I can make a working connection, but I can't add it automatically. Nothing I've been able to find so far on the Internet has helped. Any pointers?

推荐答案

如果有人仍然对此感到沮丧,那就有办法让事情发挥作用。

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

我所做的是手动输入我班级的插座,例如: @IBOutlet weak var someView:UIView!,然后拖动从代码到IB或storyboard中的视图。在此之后,我可以从IB / Storyboard拖到我的班级进行连接,助理编辑在自动中识别班级......等等。

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...

时间。

这篇关于“找不到名为ViewController的类的任何信息”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆