即使接口生成器是一个MyClass,我得到一个错误时启动应用程序。
当MyClass是库的一部分时,就会发生这种情况,如果直接在应用程序目标中编译该类则不会发生这种情况。
即使接口生成器是一个MyClass,我得到一个错误时启动应用程序。
当MyClass是库的一部分时,就会发生这种情况,如果直接在应用程序目标中编译该类则不会发生这种情况。
当前回答
I tried most of the solutions you guys suggested above but to no avail. After reading the solution from user776904's I suspected I was having the same issue as I had rebuilt my app from the ground up but copied the xib files from the previous project. I suspected the xib file had a reference to the old project that was causing my error so I simply deleted my mainwindow_ipad.xib file and copied in a new one from a clean new project. This solved it. And I was not game enough to start changing bits of the xib file in its source code.
其他回答
我今天使用Swift确实遇到了这个问题。
我修改了一个类Model.h + Model。m to a Model.swift。 该对象在Interface Builder中使用class = Model。
一旦我替换了对象,类就不能再加载了。
我所要做的就是把IB的课程参考改为:
Class = Model
Module =
to
Class = Model
Module = <TARGETNAME>
您将在构建设置中找到<TARGETNAME>。它也是在你生成的Swift-Header中出现的名称:
转到构建阶段->编译源代码并添加新的。m文件。
如果你有多个StoryBoard并且其中一个StoryBoard使用的是不存在的,那么这个“Interface Builder file中的Unknown class”错误就会在运行时出现。
在我的例子中,我有XCode6,指定的类.m文件最终在构建阶段的错误位置-它应该在编译源下,但最终在
我通过从我的class.h和.m复制文本来修复这个问题,从项目中删除这些类文件,并使用“添加文件”创建新的class.h和.m文件。然后我将代码粘贴回新文件中,一切都运行良好。由于某种原因,文件在创建时没有正确链接。在那之后,我不需要使用任何链接标志。