开发者

IBPlugin and paths to framework

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 开发者_StackOverflowdid 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.


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)


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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜