即使接口生成器是一个MyClass,我得到一个错误时启动应用程序。
当MyClass是库的一部分时,就会发生这种情况,如果直接在应用程序目标中编译该类则不会发生这种情况。
即使接口生成器是一个MyClass,我得到一个错误时启动应用程序。
当MyClass是库的一部分时,就会发生这种情况,如果直接在应用程序目标中编译该类则不会发生这种情况。
当前回答
只需在appdelegate applicatoindidfinishlanching方法的开头添加以下代码,就可以正常工作了
(myclass类);
其他回答
我沿着劳拉建议的路线修复了这个问题,但我不需要重新创建文件。
使用XCode 4,在Project Navigator中,选择包含它要抱怨的类的.m文件 点击查看->实用工具->显示文件检查器(这将显示文件检查器在右边,带有。m- File信息) 打开Target Membership部分,并确保为这个.m文件选择了目标
当我把我的.m文件添加到我的项目时,由于某种原因,它没有把它添加到我的默认目标中,这导致我得到你提到的错误。
我在《Swift》中遇到过这种情况。
将.xib文件移动到项目的Base中。Lproj文件夹摆脱了这个错误。
我在更改类名时看到了这个错误,尽管更新了所有相关的.h和.m。结果,我错过了更新.storyboard文件中的“customClass”值。这样问题就解决了。
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.
在我的例子中,问题是一个死的IBOutlet链接。一旦这个问题解决了,一切又恢复了正常。