如何在Xcode 4中“添加现有框架”?

时间:2010-07-28 12:12:21

标签: xcode frameworks xcode4

我找不到好的旧“添加现有框架”选项。我该怎么做?

我们谈论的是Xcode 4 DP2(在iPhone开发的背景下,就重要而言......)。

11 个答案:

答案 0 :(得分:1709)

As per Apple's documentation:

  1. 在项目导航器中,选择 你的项目。
  2. 选择目标。
  3. 选择“构建阶段”标签。
  4. 打开“链接二进制文件库” 膨胀器。
  5. 点击 + 按钮。
  6. 选择您的框架。
  7. (可选)拖放添加的内容 框架到“框架”组。

答案 1 :(得分:39)

我刚刚将现有的框架文件夹手动添加到项目导航器中。为我工作。

答案 2 :(得分:23)

我想指出,如果在构建阶段选项卡中找不到“使用库链接二进制文件”,请单击右下角的“添加构建阶段”按钮。

答案 3 :(得分:19)

按照以下5个步骤在项目中添加框架。

  1. 点击Project Navigator。
  2. 选择目标(下图中的黑色箭头)。
  3. 选择构建阶段(下图中的蓝色箭头)。
  4. 点击 + 按钮(下图中的绿色箭头)。
  5. 从列表中选择框架
  6. Framework

    以下是官方Apple [{3}}

答案 4 :(得分:14)

另一种简单的方法是在项目文件夹中引用它,例如“Frameworks”,它是:

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"  

它将出现在您想要的项目导航器中,以及目标“Build Phases”窗格的“Link Binary With Libraries”区域。

答案 5 :(得分:10)

我的计算机中的frameworks目录如下: /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/System/Library/Frameworks

不是目录

/Developer/SDKs/MacOSXversion.sdk/System/Library/Frameworks

答案 6 :(得分:7)

在项目中

  1. 选择项目导航器
  2. 点击Build Phases
  3. 点击链接二进制文件库
  4. 单击+按钮并添加框架

答案 7 :(得分:4)

按照屏幕截图

Go to linked framework and libraries

enter image description here

你准备好了!

答案 8 :(得分:2)

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

  2. 选择目标。

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

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

  5. 选择您的框架。

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

    enter image description here

答案 9 :(得分:1)

Xcode 12

只需将其拖到Frameworks, Libraries, and Embedded Content的{​​{1}}部分的General中即可:

enter image description here 完成!

请注意 Xcode 11和10的流程也非常相似。

答案 10 :(得分:0)

启动你应该使用的 Xcode v11

<Project settings> -> <App Target> -> Frameworks, Libraries, and Embedded Content
//or
<Project settings> -> <Framework Target> -> Frameworks and Libraries

[Frameworks, Libraries, and Embedded Content plus Frameworks and Libraries with Embed vs Do Not Embed]

另外不要忘记勾选 Library Search PathsFramework Search Paths。我建议您使用拖放[About]

[Step-by-step examples here]