【发布时间】:2012-02-17 05:32:08
【问题描述】:
更新
我已经花时间学习如何使用 install_name_tool 和 otool 来正确执行此操作,并在此处记录了该过程:Using Frameworks Within NSBundles
我想在我正在制作的 NSBundle 中使用 Connection Kit 框架。
为了让我的包成功加载框架,我将dynamic library install name 更改为使用@loader_path 而不是@executable_path。
在我的 NSBundle 中构建并包含框架之后,然后构建它,运行加载我的包的程序,我的包无法加载并产生以下输出:
Error loading MyBundle.rwplugin/Contents/MacOS/MyBundle: dlopen(/Users/facelap/Library/Developer/Xcode/DerivedData/MyBundle-hiyhdkndcnuhspfqwcuyneqobeou/Build/Products/Debug/MyBundle.rwplugin/Contents/MacOS/MyBundle, 265): Library not loaded: @executable_path/../Frameworks/DAVKit.framework/Versions/A/DAVKit
Referenced from: /Users/facelap/Library/Developer/Xcode/DerivedData/MyBundle-hiyhdkndcnuhspfqwcuyneqobeou/Build/Products/Debug/MyBundle.rwplugin/Contents/MacOS/../Frameworks/Connection.framework/Versions/A/Connection
Reason: image not found
似乎Connection Kit本身使用了一个框架。
我也有这个框架的来源。我尝试将其dynamic library install name 设置为@loader_path,但这导致了类似的输出(并且捆绑包无法加载)。
对于要在 NSBundle 中使用的框架中的框架,dynamic library install name 的合理条目是什么?
【问题讨论】:
标签: objective-c cocoa nsbundle