我正在编写一个框架(称为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)
我能将一个框架包含在另一个框架中吗?这是正确的做法吗?如何解决我的错误?