IBPlugin 和框架路径
当 IB 找不到框架时,IBCooaSimulator 会崩溃,我想你也会遇到这种情况。当我手动将框架 + ibplugin 从构建目录复制到 /Users/username/Library/Frameworks
时,我可以运行 IBCocoaSimulator 而不会崩溃。我正在使用 Finder 执行此操作,这不是最佳选择,但可行。
我一直在寻找一种更智能的方法,我一直在寻找的每个解决方案(BWToolkit、BGHUDAppKit、KTUIKit)以多种不同的方式做事。一种解决方案运行 sudo 脚本,将其复制到系统范围的 /Library/Frameworks
。另一个设置@loader_path
,另一个使用@executable_path
。我对其中任何一个都没有运气,而且由于差异很大,很难看出其中的模式。
我很困惑。
如何配置 IBPlugin,以便将其嵌入到您的应用程序中?
更新 1:
是的,在阅读 dribin 的博客文章关于如何使用@rpath,我弄清楚了如何获取它与我的 IBPlugins 一起使用。因此不再需要使用 Finder 进行复制。
我所做的是:
- 对于 MySmallFramework 将
Installation Directory
设置为@rpath
- 对于 MySmallPlugin 将
Runpath Search Paths
设置为@loader_path/../ Frameworks
- 对于 MySmallApp,将
Runpath Search Paths
设置为@loader_path/../Frameworks
很好。
IBCocoaSimulator crashes when IB cannot find the framework, I assume that happens to you too. I can run IBCocoaSimulator without crash, when I manually copy my framework+ibplugin from the build dir into /Users/username/Library/Frameworks
. I'm doing this with Finder, this is not optimal, but works.
I have searched for a smarter way and each solution (BWToolkit, BGHUDAppKit, KTUIKit) I have been looking at, does things in much different ways. One solution runs a sudo script that copies it to the system wide /Library/Frameworks
. Another sets @loader_path
and yet another uses @executable_path
. I haven't had luck with any of them and because of the great differences it's hard to see the pattern.
I'm confused.
How do you config you IBPlugin, so that you can embed it in your app?
UPDATE 1:
Yay, solved it, after reading a blog post by dribin about how to use @rpath, I figured out how to get it working with my IBPlugins. So copy using Finder is no longer needed.
What I did was:
- For MySmallFramework set
Installation Directory
to@rpath
- For MySmallPlugin set
Runpath Search Paths
to@loader_path/../Frameworks
- For MySmallApp set
Runpath Search Paths
to@loader_path/../Frameworks
Nice.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对你们大多数人来说可能是显而易见的,但是 Neoneye 在他的“更新 1”中发布的解决方案要求您的插件目标具有给定的“复制框架文件”构建阶段 分配给的框架。
(还没有足够的积分来直接发表评论:(因此有了答案)
Might be obvious to most of you, but neoneye's solution as posted in his "Update 1" requires your plugin target to have a "copy framework files" build phase with the given framework assigned to.
(don't yet have enough points for direct commenting :( hence the answer post)
您可以使用 ibplugin makefile 中的外部 makefile xcode 项目来调用它,如下例所示:
You can call this with external makefiles xcode project from ibplugin makefile like following example: