你的位置:首页 > 软件开发 > 操作系统 > iOS Xcode, 解决“Could not insert new outlet connection: Could not find any information for the class named”的问题。

iOS Xcode, 解决“Could not insert new outlet connection: Could not find any information for the class named”的问题。

发布时间:2016-04-01 16:00:07
在Xcode中,我们可以在StoryBoard编辑界面或者是xib编辑界面中通过“Control键+拖拽“的方式将某个界面元素和对应的代码文件连接起来,在代码文件中创建outlet。 不过,如果你的运气不太好,执行以上操作的过程中你可能 ...

iOS Xcode, 解决“Could not insert new outlet connection: Could not find any information for the class named”的问题。

在Xcode中,我们可以在StoryBoard编辑界面或者是xib编辑界面中通过“Control键+拖拽“的方式将某个界面元素和对应的代码文件连接起来,在代码文件中创建outlet。

 

不过,如果你的运气不太好,执行以上操作的过程中你可能会遇到下面这样的错误:

Could not insert new outlet connection: Could not find any information for the class named "xxx".

其中的“xxx”就是你的目标代码文件中的类名。如果自己没有错误,这完全是Xcode的原因。

下面,介绍一种简单方便的方法:

1: 删除并重新添加.h和.m文件

选中出问题的.m和.h文件,点删除键,然后选“Remove Reference”,不要真正删除文件。接着选“File -> Add Files to ...”菜单,在文件选择界面选择刚才的.m文件和.h文件将他们重新加入项目中。

iOS Xcode, 解决“Could not insert new outlet connection: Could not find any information for the class named”的问题。

 

iOS Xcode, 解决“Could not insert new outlet connection: Could not find any information for the class named”的问题。

马上试一下是不是已解决!


原标题:iOS Xcode, 解决“Could not insert new outlet connection: Could not find any information for the class named”的问题。

关键词:IOS

IOS
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。