Core-Plot:Interface Builder 文件中存在未知类 CPLayerHostingView
使用 core-plot 似乎不是一个简单的集成任务。标头路径已设置。在 Interface-Builder 中,我创建了一个 CPLayerHostingView ,它属于由 Interface Builder 实例化的视图控制器。
加载 nib 文件后,我收到消息:
Unknown class CPLayerHostingView in Interface Builder file
Using core-plot does not seem to be an easy integration task. Header path are already setup. In Interface-Builder I create an CPLayerHostingView which belongs to a View Controller which is instantiated by Interface Builder.
When the nib file is loaded I get the message:
Unknown class CPLayerHostingView in Interface Builder file
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我认为您是说在应用程序代码中加载 NIB 文件时出现此错误。在这种情况下,该错误表明您尚未将 Core Plot 类构建到应用程序 (iPhone) 中,或者尚未链接到 CorePlot 框架并复制到应用程序包的 Frameworks/ 目录 (OS X) 中。
I think you're saying that you get this error when you load the NIB file in your app's code. In that case, the error suggests that you haven't built the Core Plot classes into your application (iPhone) or linked against the CorePlot framework and copied into the app bundle's Frameworks/ directory (OS X).
CPGraphHostingView
谢谢你,它也对我有用;
3 小鬼东西
1>对项目目标和应用程序目标进行设置。(确保配置是所有配置)
2>为框架库提供正确的头搜索路径
3>学习它::::::-)
CPGraphHostingView
thank u it worked for me aswell;
3 imp things
1>perform settings for both project target aswell as application target.(make sure configuration is all configuration)
2>give correct header search path for framework library
3>learn over it::::::-)
无论它的价值如何。
遵循教程: http://www.switchonthecode.com/ Tutorials/using-core-plot-in-an-iphone-application 并最终出现了同样的错误。我查看了CorePlot框架文件夹,没有找到CPLayerHostingView,但在iPhoneOnly文件夹中找到了CPGraphHostingView。
在IB中将CPLayerHostingView更改为CPGraphHostingView,错误消失。
因此,请检查您的内容并使用它。可以工作。
For whatever it is worth.
Followed tutorial: http://www.switchonthecode.com/tutorials/using-core-plot-in-an-iphone-application and ended up having that same error. I looked into the CorePlot framework folder and did not find that CPLayerHostingView there, but found CPGraphHostingView inside iPhoneOnly folder.
Changed CPLayerHostingView to CPGraphHostingView in IB and error disappeared.
So, check what is in yours and use it. May work.
我发现该对象有两个不同的版本。一种仅适用于 Mac,称为“CPLayerHostingView”,一种仅适用于 iPhone,称为“CPGraphHostingView”。
如果遵循 http://www.switchonthecode 上的流行示例.com/tutorials/using-core-plot-in-an-iphone-application 如果构建 iPhone 应用程序,您将使用以下行:
I found, that there are two different versions of that object. One for Mac-Only called "CPLayerHostingView", one for iPhone only called "CPGraphHostingView".
If following the poplular example at http://www.switchonthecode.com/tutorials/using-core-plot-in-an-iphone-application you would use the following lines, if building an iPhone-App:
http://www.switchonthecode.com/tutorials/ using-core-plot-in-an-iphone-application
这是答案..
你可以在那里看到 mars 的答案
“我让它工作......好吧,我添加了 -all_load -ObjC 标志在“目标>设置”中......我认为这是每个人都感到困惑的地方......有两个地方可以放置其他链接和标题搜索路径,在“项目设置”和“目标设置”中......”
所以解决方案是
添加 -项目设置和目标设置中的 all_load -ObjC
http://www.switchonthecode.com/tutorials/using-core-plot-in-an-iphone-application
Here is the answer ..
U can see mars' answer there
"i got it to work....ok, i added the -all_load -ObjC flag in the Target>Settings....I think this is where everyone gets confused...There are 2 places where to put the other link and header search paths, in Project Settings and in Target Settings.."
So solution is
Add -all_load -ObjC in Project settings and target settings
我必须将 CPLayerHostingView 重命名为 CPGraphHostingView 才能在升级到最新版本的核心图(以及 iOS 4 和 XCode 的升级)后使其正常工作。
I had to rename CPLayerHostingView to CPGraphHostingView to get this to work after upgrading to the latest version of core plot (along with iOS 4 and the upgrade of XCode).