开发者

How do I properly embed third-party frameworks in my Cocoa application?

I am writing a Cocoa application that makes use of the ParseKit framework (http://www.parsekit.com/). I've included the Framework in the proper folder, added a Copy Files build phase, and added it to the build phase. I can build and launch the application on my Mac.

However, when I try to run it on another Mac, it crashes. The Console shows the following error message:

dyld: Library not loaded: /Users/Jordan/Files/ParseKit/build/Debug/ParseKit.framework/Versions/A/ParseKit

It looks like when the app launches, it is looking for the framework on my local drive. However, the framework is in the Copy Files build p开发者_Python百科hase, so it has been copied into that application's Contents/Frameworks folder. If if the application were looking in this folder, it would be able to load the framework just fine, but for some reason it's looking for it on my local drive on the original Mac (which obviously doesn't exist on the other Mac).

What am I doing wrong?


Use install_name_tool to change the framework’s install path to “@loader_path/../Frameworks/”.


Since it sounds like you're building it from source, set the install path in its Xcode project. You should submit a patch to the original developers once you get it working (partly to make it easier for you to keep up with future updates to the framework).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜