xcode 在 iOS 项目中添加第三方框架

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19721668/
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-15 04:14:33  来源:igfitidea点击:

Add third Party Frameworks in a project in iOS

iosobjective-cxcodeopengl-esios-frameworks

提问by Sabs

I am trying to use the NinevehGL frameworkin my iPad app. I've added the framework to my Xcode project. However, when I run my app,it executes successfully.

我正在尝试在我的 iPad 应用程序中使用NinevehGL 框架。我已将框架添加到我的 Xcode 项目中。但是,当我运行我的应用程序时,它会成功执行。

Note: After i installed the NinevehGl.pkg, The NinevehGl framework is shows in the project Template itself.

注意:安装NinevehGl.pkg 后,NinevehGl 框架显示在项目模板本身中。

enter image description here

在此处输入图片说明

Am selecting this template means automatically it creates some frameworks in Link Binary with Libraries.

选择此模板意味着它会自动在 Link Binary with Libraries 中创建一些框架。

enter image description here

在此处输入图片说明

But my issue is: While am running the same Xcode project in other mac, it crash. Because other mac's am not installed this package. So i want to add this framework in the project itself. How to add this?

但我的问题是:当我在其他 mac 上运行相同的 Xcode 项目时,它崩溃了。因为其他 mac 没有安装这个包。所以我想在项目本身中添加这个框架。这个怎么加?

回答by Shamsudheen TK

To begin with there are a few frameworks we will need to add.

首先,我们需要添加一些框架。

Do this by first selecting your projects main file in the project navigator pane.

为此,首先在项目导航器窗格中选择您的项目主文件。

Make sure your projects target is selected, and under Build Phasesclick ‘Link Binaries with Libraries'.

确保选择了您的项目目标,然后在Build Phases 下单击“ Link Binaries with Libraries”。

enter image description here

在此处输入图片说明

Use the +at the bottom of this display and add the QuartsCoreand OpenGLESframeworks.

使用此显示底部的+并添加QuartsCoreOpenGLES框架。

Next, using the ‘Add Other' button, navigate to your downloaded NinevehGL folderand import the NinevehGL.framework.

接下来,使用“添加其他”按钮,导航到您下载的NinevehGL 文件夹并导入NinevehGL.framework

enter image description here

在此处输入图片说明

Now onto the code…….import NinevehGL into your header (.h) file,

现在进入代码…….将 NinevehGL 导入到您的头文件 (.h) 中,

#import <NinevehGL/NinevehGL.h>

add the delegate to your @interface, if this is missing your drawview method will never get called.

将委托添加到您的@interface,如果缺少它,您的 drawview 方法将永远不会被调用。

@interface ViewController : UIViewController <NGLViewDelegate>;

Answer Referenced from icodeblog

icodeblog引用的答案