tags:

views:

122

answers:

2

0 Hi, i am using Core-plot . but when i declare the normal UIView as CPLayerHostingView,how can i handle drawRect of that view , i cant give another custom UIview name and write code in drawRect of that view?please any help to handle drawRect of CPLayerHostingView?

+1  A: 

Put the CPLayerHostingView inside another UIView. The background from your custom UIView will show through if you use transparent fills in the graph.

Eric Skroch
but i want to handle touch event on CPLayerHostingView,is it possible?
Mikhail Naimy
It depends on what you need the touch event for. Core Plot already support touch events for scrolling the graph.
Eric Skroch
A: 

Put the CPLayerHostingView inside another UIView. The background from your custom UIView will show through if you use transparent fills in the graph.

 i did this but i get on exception like this Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView setHostedLayer:]: unrecognized selector sent to instance 0x5d20910'
anwer
Make the CPLayerHostingView a subview of the UIView. You still have to add the Core Plot graph to the CPLayerHostingView. It sounds like you tried to add it to your UIView.
Eric Skroch