prajakta
prajakta

Reputation: 673

core plot graph draw issue in iphone

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

#### Update

i 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

Answers (1)

Rahul Vyas
Rahul Vyas

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

Related Questions