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

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


当前回答

我有“Interface Builder file中的未知类favoritesbutton”,并将其追踪到一个故事书场景,其中有问题的按钮在身份检查器顶部的class字段中有一个伪自定义类“favoritesbutton”。我想把这个值放在下一个字段:Identity Label。

将其更改为“UIButton”解决了这个问题。

其他回答

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)

这是一个Xcode4缓存问题,删除所有文件夹 /Users/your_user/Library/Application Support/iPhone Simulator/4.3/Applications/

此外,如果你在iPhone上测试时遇到同样的问题,在运行之前删除旧应用程序……

祝你好运。帕斯卡

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

在我的情况下,我得到这个错误消息由一个非常愚蠢的错误由我:在接口构建器上,我想设置一个UITableViewCell的标识符,但我意外地键入标识符到'自定义类'的接口构建器条目。

我在....之前制造了1000次细胞

从接口生成器/故事板被引用到一个不可用的类。

如果是已知类,则没有链接。

如果不是一个类,或者只是一些字符,则可能是打字错误。 在这种情况下,检查视图控制器中这个'unknown class'的所有字段。 在“身份检查器”中(块“自定义类”左起第三个)是一个字段 '类',其中可能包含错误的值。通常它会列出字段类型 (UIView / UILabel等)。