即使接口生成器是一个MyClass,我得到一个错误时启动应用程序。
当MyClass是库的一部分时,就会发生这种情况,如果直接在应用程序目标中编译该类则不会发生这种情况。
即使接口生成器是一个MyClass,我得到一个错误时启动应用程序。
当MyClass是库的一部分时,就会发生这种情况,如果直接在应用程序目标中编译该类则不会发生这种情况。
当前回答
我在《Swift》中遇到过这种情况。
将.xib文件移动到项目的Base中。Lproj文件夹摆脱了这个错误。
其他回答
不仅在项目设置中,在目标设置中也必须添加-all_load -ObjC标志。
Core-Plot: Interface Builder文件中的未知类CPLayerHostingView
从接口生成器/故事板被引用到一个不可用的类。
如果是已知类,则没有链接。
如果不是一个类,或者只是一些字符,则可能是打字错误。 在这种情况下,检查视图控制器中这个'unknown class'的所有字段。 在“身份检查器”中(块“自定义类”左起第三个)是一个字段 '类',其中可能包含错误的值。通常它会列出字段类型 (UIView / UILabel等)。
在我的情况下,我得到这个错误消息由一个非常愚蠢的错误由我:在接口构建器上,我想设置一个UITableViewCell的标识符,但我意外地键入标识符到'自定义类'的接口构建器条目。
我在....之前制造了1000次细胞
In my case I got this error because I'd tried to save some work by creating a new project and then deleting several of the source files and copying over the source files of the same name from the working project. I also copied my MainStoryBoard file which was looking for my RootViewController. However, when I had deleted the original RootViewController and then added in the RootViewController from the previous product, evidently the Add Files operation failed to "check" the target box as suggested above. By merely visting all of the newley imported ".m" files and making sure that the target membership box was checked, all was well. I think what was happening was that the storyboard file was looking for a class that had been "excluded" from the link because the target membership was unchecked. Making sure the required files for the target are so designated in the target membership in the file inspector did the trick. Thanks Pat! (see above)
只需在appdelegate applicatoindidfinishlanching方法的开头添加以下代码,就可以正常工作了
(myclass类);