有没有用过core plot的朋友?有个问题请教一下
我现在需要一个frame上同时显示多个图表,但是我用subview的时候,程序就crash了,直接用self.view没事,这是为什么?我跟踪了一下也没发现什么问题?有谁这么用过?求指点。
代码如下
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; //这一行报错了。
-------下面这个直接用self.view不报错
graph = [[CPTXYGraph alloc] initWithFrame:self.view.bounds];
CPTTheme *theme = [CPTTheme themeNamed:kCPTDarkGradientTheme];
CPTGraphHostingView *hostingView = (CPTGraphHostingView *)self.view;
hostingView.hostedGraph = graph;