i am using core plot framework,when i run following code in viewdidload gives crash.the view is as custom view…
graph = [(CPXYGraph *)[CPXYGraph alloc] initWithFrame:CGRectZero];
CPLayerHostingView *hostingView = (CPLayerHostingView *)self.view;
hostingView.hostedLayer = graph;**(gives error)**
what i have to do? any help please?
You can’t just cast
self.viewto a CPLayerHostingView. You need to make sure it is actually is one. You can do that in Interface Builder or in code if you’re initializing your view that way.