如何在 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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 03:28:38  来源:igfitidea点击:

How to "add existing frameworks" in Xcode 4?

xcodeframeworksxcode4

提问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

As per Apple's documentation:

根据 Apple 的文档:

  1. In the project navigator, select your project.
  2. Select your target.
  3. Select the "Build Phases" tab.
  4. Open "Link Binaries With Libraries" expander.
  5. Click the +button.
  6. Select your framework.
  7. (optional)Drag and drop the added framework to the "Frameworks" group.
  1. 在项目导航器中,选择您的项目。
  2. 选择你的目标。
  3. 选择“构建阶段”选项卡。
  4. 打开“ Link Binaries With Libraries”扩展器。
  5. 单击+按钮。
  6. 选择您的框架。
  7. (可选)将添加的框架拖放到“框架”组。

回答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 个步骤在您的项目中添加框架。

  1. Click on Project Navigator.
  2. Select Targets(Black arrow in the below image).
  3. Select Build phases( Blue arrow in the below image).
  4. Click on +Button (Green arrow in below image).
  5. Select your frameworkfrom list.
  1. 单击项目导航器。
  2. 选择目标(下图中的黑色箭头)。
  3. 选择构建阶段(下图中的蓝色箭头)。
  4. 单击+按钮(下图中的绿色箭头)。
  5. 从列表中选择您的框架

Framework

框架

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

在项目中

  1. Select the project navigator
  2. Click on Build Phases
  3. Click on link binary with libraries
  4. Click on + Button and add your Frameworks
  1. 选择项目导航器
  2. 单击构建阶段
  3. 单击链接二进制与库
  4. 单击 + 按钮并添加您的框架

回答by Tunvir Rahman Tusher

Follow the screen shots

按照屏幕截图

Go to linked framework and libraries

转到链接的框架和库

enter image description here

在此处输入图片说明

you are ready to Go!

你准备好了!

回答by SARATH SASI

  1. In the project navigator, select your project.

  2. Select your target.

  3. Select the "Build Phases" tab.

  4. expander. Click the + button.

  5. Select your framework.

  6. (optional) Drag and drop the added framework to the "Frameworks" group.

    enter image description here

  1. 在项目导航器中,选择您的项目。

  2. 选择你的目标。

  3. 选择“构建阶段”选项卡。

  4. 扩张器。单击 + 按钮。

  5. 选择您的框架。

  6. (可选)将添加的框架拖放到“框架”组中。

    在此处输入图片说明