即使接口生成器是一个MyClass,我得到一个错误时启动应用程序。
当MyClass是库的一部分时,就会发生这种情况,如果直接在应用程序目标中编译该类则不会发生这种情况。
即使接口生成器是一个MyClass,我得到一个错误时启动应用程序。
当MyClass是库的一部分时,就会发生这种情况,如果直接在应用程序目标中编译该类则不会发生这种情况。
当前回答
在我的例子中,这是因为我在.h文件中声明了UITableView单元格的子类的子类(两个子类的声明都在同一个.h文件中),但忘记在.m文件中对第二个子类进行空实现。
不要忘记实现你在.h文件中声明的子类的任何子类!听起来很简单,但很容易忘记,因为如果你在每个.h/中使用一个类,Xcode会为你做这件事。m文件。
其他回答
不仅在项目设置中,在目标设置中也必须添加-all_load -ObjC标志。
Core-Plot: Interface Builder文件中的未知类CPLayerHostingView
只需在appdelegate applicatoindidfinishlanching方法的开头添加以下代码,就可以正常工作了
(myclass类);
我在目标中添加了Build Phase文件,问题得到了解决。关于添加文件的步骤,请参阅我的回答:
Apple Mach-O连接器错误(APActivityIcon)
有时IBuilder会错过customModule="AppName" customModuleProvider="target"
要修复它,打开storyboard作为源代码并替换这一行:
<viewController storyboardIdentifier="StoryboardId" id="SomeID" customClass="CustomClass"
sceneMemberID="viewController">
:
<viewController storyboardIdentifier="StoryboardId" id="SomeID" customClass="CustomClass"
customModule="AppName" customModuleProvider="target" sceneMemberID="viewController">
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)