即使接口生成器是一个MyClass,我得到一个错误时启动应用程序。
当MyClass是库的一部分时,就会发生这种情况,如果直接在应用程序目标中编译该类则不会发生这种情况。
即使接口生成器是一个MyClass,我得到一个错误时启动应用程序。
当MyClass是库的一部分时,就会发生这种情况,如果直接在应用程序目标中编译该类则不会发生这种情况。
当前回答
在我的情况下,我得到这个错误消息由一个非常愚蠢的错误由我:在接口构建器上,我想设置一个UITableViewCell的标识符,但我意外地键入标识符到'自定义类'的接口构建器条目。
我在....之前制造了1000次细胞
其他回答
转到构建阶段->编译源代码并添加新的。m文件。
在我的例子中,自定义UIView类是在一个嵌入式框架中。我将自定义的UIView头文件“project”改为“public”,并将其包含在主头文件中。
我一直有这个错误与WatchKit一遍又一遍,似乎是当有一个用户界面元素没有绑定到代码中的出口。我猜这在WatchKit中是必需的。
class InterfaceController: WKInterfaceController {
@IBOutlet weak var table: WKInterfaceTable!
}
重要提示:只连接最外层的元素。例如,如果你试图为表中的某些东西提供连接,比如行中的标签,你会得到一个编译器错误,说出口是无效的,不能连接到重复的内容。
只需删除MyClass。M和。h,并将它们再次添加到项目是我的工作。
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)