即使接口生成器是一个MyClass,我得到一个错误时启动应用程序。
当MyClass是库的一部分时,就会发生这种情况,如果直接在应用程序目标中编译该类则不会发生这种情况。
即使接口生成器是一个MyClass,我得到一个错误时启动应用程序。
当MyClass是库的一部分时,就会发生这种情况,如果直接在应用程序目标中编译该类则不会发生这种情况。
当前回答
删除错误的最好方法是: 1)选择类文件(.m) 2)在“目标会员”下,“勾选”项目名称条目
其他回答
这让我有点抓狂,上面的建议都没有帮助我摆脱这个错误。幸运的是,我只有一个IB对象使用类,所以我只是删除了它,并添加了相同的类指定。错误消失了……
每个苹果文档
对于64位和iPhone操作系统应用程序,有一个链接器错误 阻止-ObjC从静态库中加载对象文件 只包含类别,不包含类。解决方法是使用 -all_load或-force_load标志。
简而言之,在你的“构建设置”中添加-all_load到“其他链接器”标志,你应该没问题。
http://developer.apple.com/library/mac/qa/qa1490/_index.html
有时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)