如何在 Xcode 4 中使用 Core Plot 框架?

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

How do I use the Core Plot framework with Xcode 4?

xcodexcode4core-plot

提问by M Holod

How do I install the Core Plot framework into Xcode 4?

如何将 Core Plot 框架安装到 Xcode 4 中?

This older tutorialhas instructions on how to install it for Xcode 3, but I could not find any similar instructions for Xcode 4. What do I need to do in order to use this framework with the newer Xcode?

这个较旧的教程有关于如何为 Xcode 3 安装它的说明,但我找不到任何适用于 Xcode 4 的类似说明。为了在较新的 Xcode 中使用这个框架,我需要做什么?

回答by mondousage

I made one here that followed what I did:

我在这里做了一个遵循我所做的:

http://recycled-parts.blogspot.com/2011/07/setting-up-coreplot-in-xcode-4.html

http://recycled-parts.blogspot.com/2011/07/setting-up-coreplot-in-xcode-4.html

Hope it helps!

希望能帮助到你!

回答by M Holod

It appears that I was unable to set up core plot project for the reason that I had corrupt example project which code I was using.

似乎我无法设置核心绘图项目,因为我使用的代码损坏了示例项目。

This are the steps:

这是步骤:

  • open a project
  • add quartzcore framework
  • add other linker flags: -ObjC -all_load
  • add CorePlot.xcodeproj to existing project (drag and drop)
  • add sample class (from examples folder, drag and drop)
  • drag coreplot framework from added CorePlot.xcodeproj to linked frameworks
  • 打开一个项目
  • 添加quartzcore框架
  • 添加其他链接器标志:-ObjC -all_load
  • 将 CorePlot.xcodeproj 添加到现有项目(拖放)
  • 添加示例类(来自示例文件夹,拖放)
  • 将 coreplot 框架从添加的 CorePlot.xcodeproj 拖到链接的框架中

in IB

在IB

  • drop object and associate it to sample class
  • drop custom view to window and associate it vith CPTLayerHostingView
  • connect object and custom view
  • 删除对象并将其关联到示例类
  • 将自定义视图拖放到窗口并将其与 CPTLayerHostingView 相关联
  • 连接对象和自定义视图

And hat is that (may sound complicated, but can be done in under a minute)

帽子就是这样(可能听起来很复杂,但可以在一分钟内完成)

Steps can be taken in any order, except last few.

除了最后几个之外,可以按任何顺序执行步骤。

Everithing is very similar to instructions at: http://www.switchonthecode.com/tutorials/using-core-plot-in-an-iphone-applicationexcept the way it is done in xcode4 is actually easier.

Everithing 与以下说明非常相似:http://www.switchonthecode.com/tutorials/using-core-plot-in-an-iphone-application除了它在 xcode4 中完成的方式实际上更容易。

Here are screenshoots that clarify the above steps: http://www.optimae.biz/data/stackoverflow/coreplot.pdf

以下是阐明上述步骤的屏幕截图:http: //www.optimae.biz/data/stackoverflow/coreplot.pdf

Hope this will help someone.

希望这会帮助某人。