我正在尝试使用本指南学习框架流程:https://www.raywenderlich.com/126365/ios-frameworks-tutorial。创建了一个单独的cocoa框架项目,在那里移动了一些代码 - 它成功构建,产生了 DehancerNavigation.framework 文件。
现在我正在尝试将此框架添加到另一个项目中:刚为此创建了一个空白项目,并将我的框架添加到常规选项卡上的嵌入式二进制文件中。它也出现在 Linked Frameworks and Libraries 部分。
General tab with added framework
似乎已经足够了,但现在我遇到了构建时错误:
Ld的/Users/yefim/Library/Developer/Xcode/DerivedData/DehancerNavigationTestUsageProject-eqegtcmqsajracgiyxgidupllvbp/Build/Products/Debug/DehancerNavigationTestUsageProject.app/Contents/MacOS/DehancerNavigationTestUsageProject正常x86_64的
cd / Users / yefim / Documents / Projects / DehancerNavigationTestUsageProject
导出MACOSX_DEPLOYMENT_TARGET = 10.13
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs /MacOSX10.13.sdk -L /用户/叶菲姆/库/开发商/ Xcode中/ DerivedData / DehancerNavigationTestUsageProject-eqegtcmqsajracgiyxgidupllvbp /编译/产品/调试-F /用户/叶菲姆/库/开发商/ Xcode中/ DerivedData / DehancerNavigationTestUsageProject-eqegtcmqsajracgiyxgidupllvbp /编译/产品/调试-filelist /Users/yefim/Library/Developer/Xcode/DerivedData/DehancerNavigationTestUsageProject-eqegtcmqsajracgiyxgidupllvbp/Build/Intermediates.noindex/DehancerNavigationTestUsageProject.build/Debug/DehancerNavigationTestUsageProject.build/Objects-normal/x86_64/DehancerNavigationTestUsageProject.LinkFileList -Xlinker -rpath -Xlinker @executable_path /../ Frameworks -mmacosx-version-min = 10.13 -Xlinker -object_path_lto -Xlinker / Users / yefim / Library / Developer / Xcode / DerivedData / DehancerNavigationTestUsageProjec叔eqegtcmqsajracgiyxgidupllvbp /建造/ Intermediates.noindex / DehancerNavigationTestUsageProject.build /调试/ DehancerNavigationTestUsageProject.build /对象 - 正常/ x86_64的/ DehancerNavigationTestUsageProject_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fobjc链路的运行时-L /应用/ Xcode中。应用/内容/开发商/工具链/ XcodeDefault.xctoolchain / usr / lib目录/快捷/ MacOSX的-Xlinker -add_ast_path -Xlinker /Users/yefim/Library/Developer/Xcode/DerivedData/DehancerNavigationTestUsageProject-eqegtcmqsajracgiyxgidupllvbp/Build/Intermediates.noindex/DehancerNavigationTestUsageProject。建立/调试/ DehancerNavigationTestUsageProject.build /对象 - 正常/ x86_64的/ DehancerNavigationTestUsageProject.swiftmodule -framework DehancerNavigation -Xlinker -dependency_info -Xlinker /Users/yefim/Library/Developer/Xcode/DerivedData/DehancerNavigationTestUsageProject-eqegtcmqsajracgiyxgidupllvbp/Build/Intermediates.noindex/DehancerNavigationTestUsageProject .build /调试/ DehancerNavigationTestUsageProject。建立/对象 - 正常/ x86_64的/ DehancerNavigationTestUsageProject_dependency_info.dat -o /Users/yefim/Library/Developer/Xcode/DerivedData/DehancerNavigationTestUsageProject-eqegtcmqsajracgiyxgidupllvbp/Build/Products/Debug/DehancerNavigationTestUsageProject.app/Contents/MacOS/DehancerNavigationTestUsageProject
ld:找不到框架DehancerNavigation
clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)。
我需要设置其他东西以在项目中使用框架吗?
答案 0 :(得分:0)
当我将框架复制到我的项目文件夹而不是引用它时,问题解决了(复制项目,如果需要检查器应该设置)。