如何在 Xcode 4 中“添加现有框架”?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3352664/
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 to "add existing frameworks" in Xcode 4?
提问by Ariel Malka
I can't find the good old "Add existing frameworks" option. How do I do this?
我找不到旧的“添加现有框架”选项。我该怎么做呢?
We're talking about Xcode 4 DP2 (in the context of iPhone development, as far as it matters...).
我们谈论的是 Xcode 4 DP2(在 iPhone 开发的背景下,就其重要而言......)。
回答by Cyber
- In the project navigator, select your project.
- Select your target.
- Select the "Build Phases" tab.
- Open "Link Binaries With Libraries" expander.
- Click the +button.
- Select your framework.
- (optional)Drag and drop the added framework to the "Frameworks" group.
- 在项目导航器中,选择您的项目。
- 选择你的目标。
- 选择“构建阶段”选项卡。
- 打开“ Link Binaries With Libraries”扩展器。
- 单击+按钮。
- 选择您的框架。
- (可选)将添加的框架拖放到“框架”组。
回答by Tom Wilke
I just added the existing framework folder manually into the project navigator. Worked for me.
我只是将现有的框架文件夹手动添加到项目导航器中。对我来说有效。
回答by Considerate
I would like to point out that if you can't find "Link Binaries With Libraries" in your build phases tab click the "Add build phase" button in the lower right corner.
我想指出的是,如果您在构建阶段选项卡中找不到“将二进制文件与库链接”,请单击右下角的“添加构建阶段”按钮。
回答by Hemant Singh Rathore
Follow below 5 steps to add framework in your project.
按照以下 5 个步骤在您的项目中添加框架。
- Click on Project Navigator.
- Select Targets(Black arrow in the below image).
- Select Build phases( Blue arrow in the below image).
- Click on +Button (Green arrow in below image).
- Select your frameworkfrom list.
- 单击项目导航器。
- 选择目标(下图中的黑色箭头)。
- 选择构建阶段(下图中的蓝色箭头)。
- 单击+按钮(下图中的绿色箭头)。
- 从列表中选择您的框架。
Here is the official Apple Link
这是苹果官方链接
回答by GTAE86
Another easy way to do it so that it is referenced in the project folder you want, like "Frameworks", is to:
另一种简单的方法是在你想要的项目文件夹中引用它,比如“框架”,是:
Select "Show the Project navigator"
Right-click on the project folder you wish to add the framework to.
Select 'Add Files to "YourProjectName"'
Browse to the framework - generally under /Developer/SDKs/MacOSXversion.sdk/System/Library/Frameworks
Select the one you want.
Select "Add"
It will appear in both the project navigator where you want it, as well as in the "Link Binary With Libraries" area of the "Build Phases" pane of your target.
它将出现在您想要的项目导航器中,以及目标的“构建阶段”窗格的“链接二进制文件”区域中。
回答by rml
The frameworks directory is as follow in my computer:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/System/Library/Frameworks
我电脑中的frameworks目录如下:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/System/Library/Frameworks
not the directory
不是目录
/Developer/SDKs/MacOSXversion.sdk/System/Library/Frameworks
回答by sabir
In Project
在项目中
- Select the project navigator
- Click on Build Phases
- Click on link binary with libraries
- Click on + Button and add your Frameworks
- 选择项目导航器
- 单击构建阶段
- 单击链接二进制与库
- 单击 + 按钮并添加您的框架
回答by Tunvir Rahman Tusher
Follow the screen shots
按照屏幕截图
you are ready to Go!
你准备好了!
回答by SARATH SASI
In the project navigator, select your project.
Select your target.
Select the "Build Phases" tab.
expander. Click the + button.
Select your framework.
(optional) Drag and drop the added framework to the "Frameworks" group.
在项目导航器中,选择您的项目。
选择你的目标。
选择“构建阶段”选项卡。
扩张器。单击 + 按钮。
选择您的框架。
(可选)将添加的框架拖放到“框架”组中。