iOS CorePlot如何安装 [英] iOS CorePlot how to install
问题描述
我正在尝试在我的一个iOS项目中使用CorePlot,但即使遵循说明并在线查看,我也无法正确安装框架。我觉得文档还没有发展,不再描述安装框架的正确方法。
我跟着这些说明。但有些事情对我来说没有意义,要么是因为它们不再是最新的,要么是因为我不理解。
例如,当我被告知添加在使用二进制链接二进制文件部分的库中,Core Plot库以红色突出显示。然后,当我被告知编辑标题搜索路径时,我不明白该怎么做,因为我拖入项目的.xcodeproj文件没有框架文件夹。
有人可以提供最新的noob友好指示吗?
谢谢。
<编辑:我尝试按照以下说明进行安装(手动安装),现在我遇到三个错误:
未定义架构符号x86_64:
_vDSP_maxvD,引用自:
- [CPTPlot plotRangeForField:] in libCorePlot-CocoaTouch.a(CPTPlot.o)
_vDSP_minvD,引自:
- [CPTPlot plotRangeForField:] in libCorePlot-CocoaTouch.a(CPTPlot.o)
ld:找不到架构的符号x86_64
clang:错误:链接器命令失败,退出代码为1(使用-v来查看调用)
Foundry的答案很棒如果你使用Cocoapods,但我会将为您提供手动执行的分步指南:
- 创建名为
工作区的文件夹
,并在Xcode中创建一个新的testCoreplot项目。 - 下载CorePlot,并将Source / framework文件夹复制到工作区文件夹中。将它重命名为CoreplotFramework,以避免在以后以这种方式添加其他框架时出现问题。
你应该这样:
- 启动testCoreplot项目,并从其中的finder中拖动文件CorePlot-CocoaTouch.xcodeproj。
- 选择testCoreplot目标,转到'Build Phases'选项卡,在target dependencies部分添加CorePlot-CocoaTouch,在Link Binary With Libraries部分添加libCorePlot-CocoaTouch.a。添加
加速
框架也适用于2.0版。
- 转到构建设置选项卡,查找标题搜索路径并添加
$(SRCROOT)/../ CoreplotFramework
。确保选择递归
。
- 仍然在此构建设置标签中,添加
-ObjC
标志
-
转到ViewController.m并添加
#importCorePlot-CocoaTouch.h
-
编译,一切都应该是正确的!
I am trying to use CorePlot in one of my iOS projects, but even after following the instructions and looking around online, I haven't managed to correctly install the framework. I feel like the documentation has not evolved and no longer describes the correct way to install the framework.
I followed these instructions. But some things do not make sense to me, either because they are no longer current or because I don't understand.
For instance, when I am told to add the library to the "Link binaries with binary" section, the Core Plot library is highlighted in red. Then when I am told to edit the Header Search Paths, I don't understand what to do because the .xcodeproj file I dragged into my project does not have a "framework" folder.
Could anyone please give up-to-date, noob-friendly instructions?
Thank you.
Edit: I tried to install according to the instructions below (manual installation) and I am now getting three errors:
Undefined symbols for architecture x86_64:
"_vDSP_maxvD", referenced from:
-[CPTPlot plotRangeForField:] in libCorePlot-CocoaTouch.a(CPTPlot.o)
"_vDSP_minvD", referenced from:
-[CPTPlot plotRangeForField:] in libCorePlot-CocoaTouch.a(CPTPlot.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Foundry's answer is great if you use Cocoapods, but I'll will provide you a step-by-step guide to do it manually :
- Create a folder named
Workspace
, and create a new "testCoreplot" project in it from within Xcode. - Download CorePlot, and copy the "Source/framework" folder into your workspace folder. Rename it "CoreplotFramework" in order to avoid issues if you add others frameworks this way later.
You should have this :
- Launch your testCoreplot project, and drag the file "CorePlot-CocoaTouch.xcodeproj" from the finder in it.
- Selet the testCoreplot target, go to 'Build Phases" tab, and add "CorePlot-CocoaTouch" in "target dependencies" section and "libCorePlot-CocoaTouch.a" in "Link Binary With Libraries" section. Add the
Accelerate
framework too for release 2.0.
- Go to "Build settings" tab, look for "Header search paths" and add
$(SRCROOT)/../CoreplotFramework
. Be sure you selectrecursive
.
- Still in this "build settings" tab, add the
-ObjC
flag
Go to ViewController.m and add
#import "CorePlot-CocoaTouch.h"
Compile, everything should be right !
这篇关于iOS CorePlot如何安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!