即使接口生成器是一个MyClass,我得到一个错误时启动应用程序。
当MyClass是库的一部分时,就会发生这种情况,如果直接在应用程序目标中编译该类则不会发生这种情况。
即使接口生成器是一个MyClass,我得到一个错误时启动应用程序。
当MyClass是库的一部分时,就会发生这种情况,如果直接在应用程序目标中编译该类则不会发生这种情况。
当前回答
在我的情况下,我得到这个错误消息由一个非常愚蠢的错误由我:在接口构建器上,我想设置一个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)
在我的例子中,它显示了一个甚至不存在的类的错误!我怀疑这是故事板文件中被删除的东西。如果你不能识别错误中的类文件,试试这个:
1)用sublime或其他好的编辑器打开你的项目。搜索被引用的类。 2)把上面写的全部去掉
customClass="UnrecognizedClassName"
3)节约。 4)返回xcode并清理项目,现在试着运行它。
为我工作。
这个问题似乎并没有过时。
我在Xcode 8中也遇到了同样的问题,并解决了类似smilebot的问题:
在Xcode中以“源代码”的形式打开故事板文件: 搜索被引用的类&删除整段
customClass = UnrecognizedClassName”
再次以“interfacebuilder - storyboard”的形式打开你的故事板文件,重新构建你的应用程序。
只需删除MyClass。M和。h,并将它们再次添加到项目是我的工作。
我只是想添加这个答案,因为这里的大多数答案(如果不是所有答案)都假设该类实际存在。只是链接器/编译器太笨了,看不到它。因此,答案围绕要么提醒链接器类的存在或创建一个黑客'强迫'存在它。
我的问题发生时,这条消息实际上是谈论一个不存在的类..因此,一个例子将是我回到一个旧的git修订版,没有特定的类的知识。然而编译器会报错该类不存在。
解决方案吗?
用核武器摧毁整个世界!首先删除所有构建文件,删除该目录下的所有内容 ~ /图书馆/开发/ Xcode / DerivedData 从手机中删除应用程序(如果使用模拟器,则清除模拟器内容)
之后你就可以去了