2011-05-19 64 views
2

我是新来的iPhone开发任何人可以帮助我仅使用三个使用上面的代码值iPhone Coreplot

-(NSUInteger)numberOfRecordsForPlot:(CPPlot *)plot 
{ 
    NSLog(@"Array1-->%@",Array1); 
    return [Array1 count]; 
} 

-(NSNumber *)numberForPlot:(CPPlot *)plot 
        field:(NSUInteger)fieldEnum 
       recordIndex:(NSUInteger)index 
{ 
    NSLog(@"Array1-->%@",Array1); 
    NSLog(@"marks1-->%@",marks1); 

    if(fieldEnum == CPScatterPlotFieldX) 
    { 
     return [Array1 objectAtIndex:index]; 
    } 
    else 
    { 
     if(plot.identifier == @"X Squared Plot") 
     { 
      return [marks1 objectAtIndex:index]; 
     } 
    } 
} 

iploted曲线图绘制曲线图在iPhone,但我有每个数组中的许多价值..但我想绘制每个数组中只有三个值。

+1

您需要给我们提供比您更多的信息。另外,请格式化您的代码。 – sosborn 2011-05-19 05:09:10

+1

我们还需要知道您尝试过什么,哪些不起作用。看着你的问题,我不知道如何提供帮助,因为你没有告诉我们问题是什么。 – sosborn 2011-05-19 05:25:51

回答

0

替换下面的代码:

-(NSUInteger)numberOfRecordsForPlot:(CPPlot *)plot{ 
    NSLog(@"Array1-->%@",Array1); 
    return [Array1 count]; 
    //return 50; 
} 

与下列之一:

-(NSUInteger)numberOfRecordsForPlot:(CPPlot *)plot{ 
    NSLog(@"Array1-->%@",Array1); 
    return 3; 
} 

希望这有助于!