当我使用此行绘制图表时,我的应用程序退出
CPGraphHostingView *hostingView = (CPGraphHostingView *)self.view;
hostingView.hostedGraph = barChart;
错误
[UIView setHostedGraph:]: unrecognized selector sent to instance 0x595fb20
2011-06-11 11:00:14.452 CGH[4909:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView setHostedGraph:]: unrecognized selector sent to instance 0x595fb20'
如何解决此问题,我已正确包含所有lib
####更新我再次使用它但是我收到此错误,我已将该类连接到nib文件
2011-09-28 14:53:06.791 Ihope_test_sql[9307:707] Unknown class CPTGraphHostingView in Interface Builder file.
2011-09-28 14:53:06.795 Ihope_test_sql[9307:707] Unknown class CPTGraphHostingView in Interface Builder file.
2011-09-28 14:53:06.797 Ihope_test_sql[9307:707] Unknown class CPTGraphHostingView in Interface Builder file.
2011-09-28 14:53:06.800 Ihope_test_sql[9307:707] Unknown class CPTGraphHostingView in Interface Builder file.
2011-09-28 14:53:06.847 Ihope_test_sql[9307:707] -[UIView setHostedGraph:]: unrecognized selector sent to instance 0x1cd920
2011-09-28 14:53:06.875 Ihope_test_sql[9307:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView setHostedGraph:]: unrecognized selector sent to instance 0x1cd920'
*** Call stack at first throw:
答案 0 :(得分:1)
您似乎在普通视图中托管图表。你有没有关注核心情节样本?尝试在界面构建器中将UIView类更改为CPGraphHostingView。你不会崩溃igonre接口构建器的警告。