如何在 Xcode 4.3.2 上添加框架到项目
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10546374/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How add Framework to project on Xcode 4.3.2
提问by CReaTuS
How i can add a framework to XCode 4.3.2 project ?
我如何向 XCode 4.3.2 项目添加框架?
Because a SDK directories inside a XCode.app and i can't add a framework by "Add files to ..."
因为 XCode.app 中的 SDK 目录,我无法通过“将文件添加到...”来添加框架
Updated:
更新:
For this action you can do a this steps:
对于此操作,您可以执行以下步骤:
Click on Project at left table
Click on "Build Phases" on right table
Click on "Link Binary With Libraries"
Click "+"
Find needing framework and click "Add"
单击左表中的项目
单击右侧表格中的“构建阶段”
单击“将二进制文件与库链接”
点击“+”
找到需要的框架并点击“添加”
And your needing framework in your project.
以及您项目中所需的框架。
回答by rishi
Following are steps-
以下是步骤-
1) Click project in Navigator area
1) 在导航区点击项目
2) Select 'TARGETS' tab
2) 选择“目标”选项卡
3) Click on 'Build Phases'
3)点击“构建阶段”
4) Select 'Link Binary With Libraries'
4)选择“链接二进制库”
Then you can see '+' button at the bottom in the area. You can now add the framework that you want.
然后您可以在该区域的底部看到“+”按钮。您现在可以添加所需的框架。
回答by whyoz
Although rishi's answer works great, this doesn't add the framework to the Project Navigator's "Frameworks" folder.
尽管 rishi 的回答效果很好,但这并没有将框架添加到 Project Navigator 的“Frameworks”文件夹中。
Another method is to right click any of your existing frameworks in the Project Navigator's "Frameworks" folder, select "Show in Finder," then just drag and drop the framework you want to add.
另一种方法是右键单击 Project Navigator 的“Frameworks”文件夹中的任何现有框架,选择“在 Finder 中显示”,然后拖放要添加的框架。
When it asks how you want to add the framework, make sure you add it to your target, which will then add it inside the "Link With Libraries" section of Build Phases.
当它询问您想如何添加框架时,请确保将其添加到您的目标中,然后将其添加到构建阶段的“链接库”部分中。
UPDATE:
更新:
This is merely a convenience method for adding a framework for those that are looking for the framework to show up in their "Frameworks" folder.
这只是为那些正在寻找框架以显示在其“Frameworks”文件夹中的人添加框架的便捷方法。
Read comments about not selecting the "Copy to group's destination folder" checkbox, because it will unnecessarily add it to the root of your project folder.
阅读有关不选中“复制到组的目标文件夹”复选框的评论,因为它会不必要地将其添加到项目文件夹的根目录中。
回答by Alok kumar
You can add frameworks to your application in following ways.
您可以通过以下方式向应用程序添加框架。
Click on Project panel and click on xcode project and select on Targets.
单击“项目”面板,然后单击“xcode 项目”并选择“目标”。
After selecting Targets then you click on Build Phases.
选择 Targets 后,单击 Build Phases。
In Build Phases you see list of activity like. a) Target Dependencies b) Compiler Sources c) Link Binary with Libraries d) Copy Bundle Resources
在构建阶段中,您会看到类似活动的列表。a) 目标依赖 b) 编译器源 c) 将二进制文件与库链接 d) 复制捆绑资源
Please Click on Link Binary with Libraries once you click panel expand and you can seee the list of framework. Now you have to click the +(button) then you can choose and add existing frameworks.
单击面板展开后,请单击 Link Binary with Libraries,您可以看到框架列表。现在您必须单击 +(按钮),然后您可以选择并添加现有框架。
Hope it will help you.
希望它会帮助你。