IBPlugin 和框架路径

发布于 2024-08-18 14:37:30 字数 1085 浏览 5 评论 0原文

当 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 进行复制。

我所做的是:

  1. 对于 MySmallFramework 将 Installation Directory 设置为 @rpath
  2. 对于 MySmallPlugin 将 Runpath Search Paths 设置为 @loader_path/../ Frameworks
  3. 对于 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:

  1. For MySmallFramework set Installation Directory to @rpath
  2. For MySmallPlugin set Runpath Search Paths to @loader_path/../Frameworks
  3. For MySmallApp set Runpath Search Paths to @loader_path/../Frameworks

Nice.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

爱情眠于流年 2024-08-25 14:37:30

对你们大多数人来说可能是显而易见的,但是 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)

晨敛清荷 2024-08-25 14:37:30

您可以使用 ibplugin makefile 中的外部 makefile xcode 项目来调用它,如下例所示:

install_name_tool -change @loader_path/MyPluginName.framework/MyPluginName @loader_path/<absolute path or level to updirectory>/MyPluginName.framework/MyPluginName $(BINDIR)/MyPluginName.ibplugin/Contents/MacOS/MyPluginName

You can call this with external makefiles xcode project from ibplugin makefile like following example:

install_name_tool -change @loader_path/MyPluginName.framework/MyPluginName @loader_path/<absolute path or level to updirectory>/MyPluginName.framework/MyPluginName $(BINDIR)/MyPluginName.ibplugin/Contents/MacOS/MyPluginName
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文