开发者

Creating a Cocoa Framework

I've created a working Cocoa framework which I wish to redistribute. The problem is however, it won't run outside of Xcode. I've read something about @executable_path/../Frameworks, which I did not include, because I don't know where to put it :/

Therefore I run my app in Xcode using开发者_开发知识库 the DYLD_FRAMEWORK_PATH variable which works fine, but only in Xcode - if I try to run it on its own it crashes straight away and says IMAGE NOT FOUND.

I'm sure @executable_path/../Frameworks is what's missing, but I don't know where to put it.

Could anyone help me out please? :)

Thanks


Here is how I usually manage things:

  1. In the framework's Xcode project, set the Installation Directory to @rpath

  2. Add the framework to your application's Xcode project. Add a Copy Files build phase, select Frameworks in the Destination popup, and ensure your framework is added so it will be copied to your application's Frameworks directory when it is built.

  3. Finally, in your project's settings, add @loader_path/../Frameworks to Runpath Search Paths.


Are you actually copying the framework into your applications bundle? Look for the folder called MacOS which is what contains the binary. There should be another folder at the same level called Frameworks and it should have the framework inside it.

If it's not there you need to create a copy files build phase for the application that copies the framework into the Frameworks folder.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜