构建Mac OS X/Cocoa应用程序以使用导入的框架进行分发 [英] Building a Mac OS X/Cocoa application for distribution with an imported framework
问题描述
因此,我构建了一个可以从Xcode编译并正常运行的应用程序.现在,我想将其分发给其他人,以便他们可以使用它.我该怎么做呢?
So I built an application which compiles and runs fine from Xcode. Now I want to distribute it to other people so they can use it. How do I do that correctly?
我认为它就像存档然后将其作为.pkg或应用程序共享一样简单.但是,每当我打开应用程序时,它都会崩溃并显示以下消息:
I thought it was as simple as archiving it, and then sharing it as a .pkg or an application. But whenever I open up the application it crashes with the following message:
Application Specific Information:
dyld: launch, loading dependent libraries
Dyld Error Message:
Symbol not found: _OBJC_CLASS_$_CPTBorderedLayer
Referenced from: /Users/USER/Desktop/StoreMon.app/Contents/MacOS/
StoreMon
Expected in: /Library/Frameworks/CorePlot.framework/Versions/A/
CorePlot
in /Users/USER/Desktop/StoreMon.app/Contents/MacOS/StoreMon
我正在使用 Core Plot 框架.
_CPTBorderedLayer
类是该框架的一部分.如何将该框架正确打包到我的应用中?
The _CPTBorderedLayer
class is part of that framework. How do I package this framework into my app correctly?
推荐答案
您可以为正在使用的框架提供安装程序,也可以将它们嵌入到应用程序的捆绑包中.
You can provide an installer for the framework(s) you are using, or you can embed them in your Application's bundle.
阅读框架编程指南".您正在寻找第41页:
Read the "Framework Programming Guide". Page 41 is what you are looking for:
http://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPFrameworks/BPFrameworks.pdf
诀窍是将框架文件复制到应用程序内的特殊目录中.然后,您将使用@executable_path
引用您的应用程序的二进制路径,以便在启动时将应用程序的二进制路径正确链接到您的框架.
The trick is to copy the framework files in a special directory, inside your application. Then, you'll use @executable_path
to refer to your application's binary path, so the application's will be correctly linked to your framework at launch time.
这篇关于构建Mac OS X/Cocoa应用程序以使用导入的框架进行分发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!