ConnectionKit 框架:将其添加到项目中
我正在尝试在我的应用程序中使用 ConnectionKit 框架 https://github.com/karelia/ConnectionKit但不知道如何将它作为框架添加到我的 XCode 项目中。将文件作为 .framework 添加到项目中的正确方法是什么?
谢谢。
I'm trying to use the ConnectionKit Framework https://github.com/karelia/ConnectionKit with my application but can't figure out how to add it as a framework to my XCode project. What is the proper way to add the files as .framework to a project?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
首先,打开 Framework 项目并编译它以发布(如果您获得了源代码)。
然后,您需要在应用程序项目中执行三个步骤:将其添加到项目中,创建指向它的可执行链接并将其添加到可执行包中(否则应用程序只能在您的计算机上运行)。
在项目视图中,展开框架,然后按住 Control 键单击或右键单击“链接的框架”并选择“添加”->“现有框架”。在出现的对话框中,您将获得 Apple 框架的列表和用于查找其他框架的按钮:使用它并选择您的框架,它将位于 .../FrameworkProject/Build/Release 下。
如果您已将框架添加到 Frameworks\Linked Frameworks,则第二步应该已经与第一步一起完成,但仍然要检查它。转到 Targets\YourExecutable 并展开它,然后展开“Link Binary with Libraries”。该框架应该在那里,否则请从应用程序项目中的 Frameworks\Linked Frameworks 拖放到“Link Binary with Libraries”。
现在右键/按住 Control 键单击“目标”中的可执行文件,然后选择“添加”->“新构建阶段”->“新副本文件构建阶段”。该阶段的属性表将打开,最上面的字段是“目的地:”下拉列表,默认情况下将读取“资源”,将其更改为框架并关闭窗口。现在将框架从“Frameworks\Linked Frameworks”拖放到“Targets\Your Executable\Copy files”。
First, open the Framework project and compile it for release if you got it as source code.
Then you need to perform three steps in your application project: add it to the project, make the executable link to it and add it to the executable bundle (otherwise the application will only work on your computer).
In project view, expand Frameworks and then Control-click or right-click "Linked Frameworks" and select Add->Existing Frameworks. In the resulting dialog, you will get a list of the Apple frameworks and a button for locating others: use it and select your framework, it will be under .../FrameworkProject/Build/Release.
The second step should already been done alongside the first if you have added the framework to Frameworks\Linked Frameworks, but check it nevertheless. Go to Targets\YourExecutable and expand it, then expand "Link Binary with Libraries". The framework should be there, otherwise use drag and drop from Frameworks\Linked Frameworks in your application project to "Link Binary with Libraries".
Now right/control click your executable in Targets and select Add->New Build Phase->New Copy Files Build Phase. A property sheet for the phase will open, the topmost field is a "Destination:" dropdown that will read "Resources" by default, change it to frameworks and close the window. Now drag and drop the framework from "Frameworks\Linked Frameworks" to "Targets\Your Executable\Copy files".
在 Xcode 项目中,右键单击文件夹“Frameworks”,添加 -> 现有文件。
在这里您选择“Connection.xcodeproj”(您必须下载它)。选中“如果需要则复制”。
之后,右键单击应用程序的名称(在文件夹“目标”内),然后获取信息。
现在,常规->搜索路径->标题搜索路径(双击)->按 + ->在新建中放置“Connection.xcodeproj”的路径
Inside your Xcode project, right click on the folder "Frameworks", Add->Existing Files.
Here you select "Connection.xcodeproj" (you have to download it). Check "copy if needed".
After that, right click on the name of your app (inside folder "Targets"), and Get Info.
Now, General->Search Path->Header Search Path(double click)->Press + ->In the new, place the path of the "Connection.xcodeproj"