Reputation: 673
when i use this line to draw graph my app quits
CPGraphHostingView *hostingView = (CPGraphHostingView *)self.view;
hostingView.hostedGraph = barChart;
error
[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'
how to fix this issue , i have included all lib correctly
#### Updatei am using it again but i am getting this error , i have connected the class in nib file
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:
Upvotes: 1
Views: 1369
Reputation: 28720
It seems you are hosting graph in a normal view. Did you follow core-plot sample? Try change UIView Class to CPGraphHostingView in interfaceBuilder. You will not get crash igonre the warnings of interface builder.
Upvotes: 1