我正在尝试使用 Core Plot 绘制图表,但我的图 TableView 被实例化为 UIView
即使我已将其设置为 CPTGraphHostingView
在界面生成器中:
这是我的代码:
usersGraph = [[CPTXYGraph alloc] initWithFrame:usersGraphView.frame];
usersGraphView.hostedGraph = usersGraph;
为什么会这样?
最佳答案
在 Interface Builder 中断断续续地反复尝试一切之后,我开始在 StackOverflow 上搜索更多内容,并且偶然发现了这个问题:Application crashes when working with core plot
很奇怪,但这不是 IB 问题(我确信我在 IB 中做的是正确的,我以前做过一千次),而是链接器问题。我不知道为什么,但我必须将 -ObjC
添加到链接器标志,它起作用了。
关于ios - -[UIView setHostedGraph :] unrecognized selector sent to instance,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23488933/