即使接口生成器是一个MyClass,我得到一个错误时启动应用程序。

当MyClass是库的一部分时,就会发生这种情况,如果直接在应用程序目标中编译该类则不会发生这种情况。


当前回答

在我的例子中,它显示了一个甚至不存在的类的错误!我怀疑这是故事板文件中被删除的东西。如果你不能识别错误中的类文件,试试这个:

1)用sublime或其他好的编辑器打开你的项目。搜索被引用的类。 2)把上面写的全部去掉

customClass="UnrecognizedClassName"

3)节约。 4)返回xcode并清理项目,现在试着运行它。

为我工作。

其他回答

每个苹果文档

对于64位和iPhone操作系统应用程序,有一个链接器错误 阻止-ObjC从静态库中加载对象文件 只包含类别,不包含类。解决方法是使用 -all_load或-force_load标志。

简而言之,在你的“构建设置”中添加-all_load到“其他链接器”标志,你应该没问题。

http://developer.apple.com/library/mac/qa/qa1490/_index.html

我通过从我的class.h和.m复制文本来修复这个问题,从项目中删除这些类文件,并使用“添加文件”创建新的class.h和.m文件。然后我将代码粘贴回新文件中,一切都运行良好。由于某种原因,文件在创建时没有正确链接。在那之后,我不需要使用任何链接标志。

在我的例子中,自定义UIView类是在一个嵌入式框架中。我将自定义的UIView头文件“project”改为“public”,并将其包含在主头文件中。

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.

不仅在项目设置中,在目标设置中也必须添加-all_load -ObjC标志。

Core-Plot: Interface Builder文件中的未知类CPLayerHostingView