如何在 Xcode 5 中添加现有框架
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19337890/
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 an existing framework in Xcode 5
提问by user2874675
I'm trying to add the AdColony.h frameWork after downloading it, but I can't find it in Xcode 5. I was able to do it in the last version, but can't find it in this one.
我在下载后尝试添加 AdColony.h 框架,但我在 Xcode 5 中找不到它。我能够在上一个版本中添加它,但在这个版本中找不到它。
回答by AJ112
Click on your project in the Project Navigator on the left side. In General go to "Linked Frameworks and Libraries". Click on the + button
在左侧的项目导航器中单击您的项目。一般转到“链接的框架和库”。单击 + 按钮
and click on "Add Other" and then add the framework you have downloaded.
并单击“添加其他”,然后添加您下载的框架。
回答by JJ on SE
Strange. I was just doing the same thing in XCode 5.0.2 and I had to click on the Project, select the *Tests Target, then select notthe General tab but actually the Build Phases tab to see "Link Binary With Libraries" where I was able to add the framework.
奇怪的。我只是在 XCode 5.0.2 中做同样的事情,我必须点击项目,选择 *Tests Target,然后不选择General 选项卡,而是选择Build Phases 选项卡,以查看我所在的“Link Binary With Libraries”能够添加框架。
回答by Tunvir Rahman Tusher
Follow this screen shots
按照这个屏幕截图
Run and Go
奔跑吧
回答by Agent DS
Actually, I use Xcode 6.4, and I happen to be confronted with the same problem. I tried many ways suggested by others while none worked.(no button named General as others said) Here comes my solution.
实际上,我使用的是 Xcode 6.4,但碰巧遇到了同样的问题。我尝试了其他人建议的许多方法,但都没有奏效。(没有像其他人所说的那样名为 General 的按钮)这是我的解决方案。
- Select your project in the project navigator
- Click 'Build Phases' tab
- Open 'Link Binaries With Libraries' expander
- Click button '+' to add items
- 在项目导航器中选择您的项目
- 单击“构建阶段”选项卡
- 打开“使用库链接二进制文件”扩展器
- 单击按钮“+”添加项目
step 1-4
步骤 1-4
- Search and choose the frameworks you need, for example, I choose 'OpenGL.framework', and click the button 'Add'
- 搜索并选择您需要的框架,例如,我选择“OpenGL.framework”,然后单击“添加”按钮
- Finally, you can see the frameworks you choose in the window
- 最后,您可以在窗口中看到您选择的框架
回答by PiTheNumber
Adding it in "Linked Frameworks and Libraries" as other answer discribe did not work for me in xcode 6.4.
将它添加到“链接框架和库”中作为其他答案描述在 xcode 6.4 中对我不起作用。
However drag and drop it into Frameworks folder (Project Navigator) and creating a reference did worked.
但是,将其拖放到 Frameworks 文件夹(项目导航器)中并创建引用确实有效。