I now need a frame to display multiple charts simultaneously, but I used subview, the program would crash, and the direct use self.view okay, this is why? I tracked the problem did not find anything about it? Who are so used? Seeking advice.
Code is as follows
UIView * subv = [self.view.subviews objectAtIndex: 0];
graph = [[CPTXYGraph alloc] initWithFrame: subv.bounds];
CPTTheme * theme = [CPTTheme themeNamed: kCPTDarkGradientTheme];
CPTGraphHostingView * hostingView = (CPTGraphHostingView *) subv;
hostingView.hostedGraph = graph; / / this line the error.
------- The following error
not directly self.viewgraph = [[CPTXYGraph alloc] initWithFrame: self.view.bounds];
CPTTheme * theme = [CPTTheme themeNamed: kCPTDarkGradientTheme];
CPTGraphHostingView * hostingView = (CPTGraphHostingView *) self.view;
hostingView.hostedGraph = graph;
Reply:
subview is a subview and self.view is the default view of this controller, but the graph may be because of the sub-view does not exist Failed to initialize an error
Reply:
Get their own, want to replace the original view into graphview core plot provided
Reply:
The landlord Hello, I would like to ask how the core plot also shows a view controller inside a line chart, bar chart, pie chart, ah, I use another view controller to load a core plot graph controller, but always loaded not, what is the reason ah
Reply:
Allow a controller to control multiple sub-views (CPTGraphHostingView) on the line
Reply:
Thank you, you can load came in, but CPTGraphHostingView is reversed, you can set it up yet?
Reply:
How will the anti-ah? I use are positive ah. CPTGraphHostingView coordinate origin in the lower left corner of the coordinate system origin, UIView in the upper left corner, you are not this confused?
Reply:
I was in a UIviewcontroller which added a CPTGraphHostingView and a segmented controls, CPTGraphHostingView to display maps, segmented controls to switch (line charts, bar charts, pie charts), CPTGraphHostingView which is loaded Other UIviewcontroller controller (there is figure painting)
Reply:
You say one view controller plus a few CPTGraphHostingView, line charts and bar charts but creates a view controller inside - [- (double *) doublesForPlot: (CPTPlot *) plot field: (NSUInteger) fieldEnum recordIndexRange: (NSRange ) indexRange] This method generates a line chart is not an error, but a plus histogram on the error, should not the same as line charts and bar charts inside approach, I do not know when this method is inside the histogram how to deal with
No comments:
Post a Comment