我正在使用 Coreplot API 创建条形图。当我尝试将相同的代码作为单个项目运行时,它工作正常,但是当我将它集成到我的项目内部UINavigationController
时,它给了我一个错误。
GraphView.h
@interface GraphView : CPTGraphHostingView <CPTPlotDataSource, CPTPlotSpaceDelegate>
{
CPTXYGraph *graph;
NSArray *dates;
}
@property(nonatomic, retain) NSArray *dates;
GraphView.m
dates = [NSArray arrayWithObjects:@"2012-05-01", @"2012-05-02", @"2012-05-03",
@"2012-05-04", @"2012-05-05", @"2012-05-06", @"2012-05-07", @"2012-05-08", @"2012-05-09",@"2012-05-10",@"2012-05-11",@"2012-05-12",@"2012-05-13",@"2012-05-14",@"2012-05-15",@"2012-05-16",@"2012-05-17",@"2012-05-18",@"2012-05-19",@"2012-05-20",nil];
- (NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot
{
return dates.count;
}
在返回 dates.count 它给了我错误。
[__NSArrayI count]:消息发送到已释放实例 0x6dbfd10