使用外部框架构建Objective-C应用程序

时间:2022-09-07 07:58:35

I am integrating growl into my Objective-C app.

我正在将growl集成到我的Objective-C应用程序中。

However If I build and run my app without copying the Growl.framework to ~/Library/Frameworks or a corresponding location then my App fails to execute.

但是,如果我构建并运行我的应用程序而不将Growl.framework复制到〜/ Library / Frameworks或相应的位置,那么我的应用程序无法执行。

I don't really fully understand Frameworks under objective-c, but I was wondering if there is anyway to include the Framework within my App so I don't have to manually distribute the framework to the user?

我并不完全理解objective-c下的Frameworks,但我想知道是否还有在我的应用程序中包含Framework所以我不必手动将框架分发给用户?

I believe that's what tweetweet does in there build process but I haven't quite figured out how they did it.

我相信这就是tweetweet在构建过程中的作用,但我还没弄清楚他们是如何做到的。

Thanks, Brian

1 个解决方案

#1


Yes, in your target in Xcode you need to create a new 'Copy Files' build phase (right click on the target > Add > New Build Phase > New Copy Files Build Phase). When the More Info window pops up, click on the pop up button and choose Frameworks. Drag this build phase to just below the copy resource phase and then drag any frameworks you want copied over to it.

是的,在Xcode中的目标中,您需要创建一个新的“复制文件”构建阶段(右键单击目标>添加>新构建阶段>新建复制文件构建阶段)。弹出“更多信息”窗口时,单击弹出按钮并选择“框架”。将此构建阶段拖到复制资源阶段的下方,然后将要复制的任何框架拖到它上面。

#1


Yes, in your target in Xcode you need to create a new 'Copy Files' build phase (right click on the target > Add > New Build Phase > New Copy Files Build Phase). When the More Info window pops up, click on the pop up button and choose Frameworks. Drag this build phase to just below the copy resource phase and then drag any frameworks you want copied over to it.

是的,在Xcode中的目标中,您需要创建一个新的“复制文件”构建阶段(右键单击目标>添加>新构建阶段>新建复制文件构建阶段)。弹出“更多信息”窗口时,单击弹出按钮并选择“框架”。将此构建阶段拖到复制资源阶段的下方,然后将要复制的任何框架拖到它上面。