【发布时间】:2011-03-31 18:58:30
【问题描述】:
我正在编写一个框架(称为 Lighthouse.framework),该框架又使用来自另一个框架(准确地说是 RegexKit.framework)的代码。我已将 RegexKit.framework 复制到我自己的框架中,使其具有如下结构:
Lighthouse.framework/
Versions/
A/
Frameworks/
RegexKit.framework
Lighthouse
但是,当我尝试运行使用 Lighthouse.framework(我的框架)的应用程序时,我收到以下错误:
dyld:库未加载:@executable_path/../Frameworks/RegexKit.framework/Versions/A/RegexKit
引用自:/Users/mdippery/Developer/Projects/Current/lighthouse/build/Debug/Lighthouse.framework/Versions/A/Lighthouse
原因:图片未找到
显然,加载程序没有找到 RegexKit。
这里是加载器期望加载的路径,礼貌otool:
build/Debug/Lighthouse.framework/Versions/A/Lighthouse:
/Users/mdippery/Library/Frameworks/Lighthouse.framework/Versions/A/Lighthouse (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 12.0.0)
@executable_path/../Frameworks/RegexKit.framework/Versions/A/RegexKit (compatibility version 0.4.0, current version 0.6.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.4)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 476.19.0)
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 677.26.0)
我可以在另一个框架中包含一个框架吗?这是正确的方法吗?如何解决我的错误?
【问题讨论】:
-
以下是如何将一个框架包含在另一个框架中。 stackoverflow.com/a/27638841/1582217 叫伞形框架。
标签: objective-c cocoa xcode frameworks