问题描述
我创建了一个工作的Cocoa框架,我希望重新分发。然而问题是,它不会在Xcode外部运行。我已经读了一些关于 @executable_path /../ Frameworks
,我没有包括,因为我不知道放在哪里:/
因此,我在Xcode中使用 DYLD_FRAMEWORK_PATH
变量运行我的应用程序工作正常,但只在Xcode中 - 如果我试图运行它它自己会立即崩溃,并说 IMAGE NOT FOUND
。
我确定 @executable_path /../ Frameworks
是什么缺失,但我不知道放在哪里。
任何人都可以帮助我? :)
感谢
将框架添加到应用程序的Xcode项目中。添加复制文件构建阶段,在目标弹出框中选择框架,并确保添加了框架,以便在构建时将其复制到应用程序的Frameworks目录中。
最后,在您的项目设置中,将@loader_path /../ Frameworks添加到Runpath搜索路径。
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:
In the framework's Xcode project, set the Installation Directory to @rpath
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.
Finally, in your project's settings, add @loader_path/../Frameworks to Runpath Search Paths.
这篇关于创建Cocoa框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!