2010-08-14 68 views
0

今天我試着用CorePlot編譯一個項目。用CorePlot編譯項目問題

所有的時間,我得到了以下錯誤:

".objc_class_name_NSNotificationCenter", referenced from: 
[email protected][email protected][email protected] in libCorePlot.a(CPGraph.o) 
[email protected][email protected][email protected] in libCorePlot.a(CPXYPlotSpace.o) 
".objc_class_name_NSException", referenced from: 
[email protected][email protected][email protected] in libCorePlot.a(CPScatterPlot.o) 
[email protected][email protected][email protected] in libCorePlot.a(CPBarPlot.o) 
[email protected][email protected][email protected] in libCorePlot.a(CPGraph.o) 
[email protected][email protected][email protected] in libCorePlot.a(CPGradient.o) 
[email protected][email protected][email protected] in libCorePlot.a(CPLayer.o) 
[email protected][email protected][email protected] in libCorePlot.a(CPXYPlotSpace.o) 
[email protected][email protected][email protected] in libCorePlot.a(CPTheme.o) 
[email protected][email protected][email protected] in libCorePlot.a(CPTradingRangePlot.o) 
[email protected][email protected][email protected] in libCorePlot.a(CPAxisLabel.o) 
[email protected][email protected][email protected] in libCorePlot.a(CPAxisTitle.o) 
[email protected][email protected][email protected] in libCorePlot.a(CPXYAxis.o) 
".objc_class_name_UIView", referenced from: 
.objc_class_name_CPLayerHostingView in libCorePlot.a(CPLayerHostingView.o) 
".objc_class_name_NSMutableArray", referenced from: 
[email protected][email protected][email protected] in libCorePlot.a(CPPlot.o) 
[email protected][email protected][email protected] in libCorePlot.a(CPScatterPlot.o) 
[email protected][email protected][email protected] in libCorePlot.a(CPBarPlot.o)  [ . . . ] 

我希望有人能幫助我。

編輯:它的工作,如果我嘗試編譯設備,但不適合模擬器。

+0

你如何編譯它? – kennytm 2010-08-14 21:48:06

回答

0

我似乎已經解決了我早些時候遇到的問題,但我最好猜測它只能通過添加其餘代碼來修復,它可能仍然隱藏在這7個其他錯誤的後面。我已經附加完整的視圖controller.m文件更有經驗的眼睛。

// 

// SOTC_CorePlotViewController.m // SOTC-CorePlot // // 創建者NFCU 98972在10年8月18日。 //版權2010 我的公司名稱。版權所有。 //

導入 「SOTC_CorePlotViewController.h」

@implementation SOTC_CorePlotViewController

- (NSUInteger)numberOfRecords { 返回51; }

- (的NSNumber *)numberForPlot:(CPPlot )情節字段:(NSUInteger)fieldEnum
recordIndex:(NSUInteger)指數 { 雙VAL =(索引/ 5.0)-5; if(fieldEnum == CPScatterPlotFieldX) {return [NSNumber numberWithDouble:val]; } else if(plot.identifier == @「X Squared Plot」) {return [NSNumber numberWithDouble:val
val]; } else {return [NSNumber numberWithDouble:1/val]; } } }

//實現viewDidLoad在加載視圖後執行額外的設置,通常是從一個nib。 - (void)viewDidLoad {super viewDidLoad];

graph = [[CPXYGraph alloc] initWithFrame: self.view.bounds]; 

CPLayerHostingView *hostingView = (CPLayerHostingView *)self.view; 
hostingView.hostedLayer = graph; 
graph.paddingLeft = 20.0; 
graph.paddingTop = 20.0; 
graph.paddingRight = 20.0; 
graph.paddingBottom = 20.0; 

CPXYPlotSpace *plotSpace = (CPXYPlotSpace *)graph.defaultPlotSpace; 
plotSpace.xRange = [CPPlotRange plotRangeWithLocation:CPDecimalFromFloat(-6) 
               length:CPDecimalFromFloat(12)]; 
plotSpace.yRange = [CPPlotRange plotRangeWithLocation:CPDecimalFromFloat(-5) 
               length:CPDecimalFromFloat(30)]; 

CPXYAxisSet *axisSet = (CPXYAxisSet *)graph.axisSet; 

CPLineStyle *lineStyle = [CPLineStyle lineStyle]; 
lineStyle.lineColor = [CPColor blackColor]; 
lineStyle.lineWidth = 2.0f; 

axisSet.xAxis.majorIntervalLength = [NSDecimalNumber decimalNumberWithString:@"5"]; 
axisSet.xAxis.minorTicksPerInterval = 4; 
axisSet.xAxis.majorTickLineStyle = lineStyle; 
axisSet.xAxis.minorTickLineStyle = lineStyle; 
axisSet.xAxis.axisLineStyle = lineStyle; 
axisSet.xAxis.minorTickLength = 5.0f; 
axisSet.xAxis.majorTickLength = 7.0f; 
axisSet.xAxis.axisLabelOffset = 3.0f; 

axisSet.yAxis.majorIntervalLength = [NSDecimalNumber decimalNumberWithString:@"5"]; 
axisSet.yAxis.minorTicksPerInterval = 4; 
axisSet.yAxis.majorTickLineStyle = lineStyle; 
axisSet.yAxis.minorTickLineStyle = lineStyle; 
axisSet.yAxis.axisLineStyle = lineStyle; 
axisSet.yAxis.minorTickLength = 5.0f; 
axisSet.yAxis.majorTickLength = 7.0f; 
axisSet.yAxis.axisLabelOffset = 3.0f; 

CPScatterPlot *xSquaredPlot = [[[CPScatterPlot alloc] 
           initWithFrame:graph.defaultPlotSpace.bounds] autorelease]; 
xSquaredPlot.identifier = @"X Squared Plot"; 
xSquaredPlot.dataLineStyle.lineWidth = 1.0f; 
xSquaredPlot.dataLineStyle.lineColor = [CPColor redColor]; 
xSquaredPlot.dataSource = self; 
[graph addPlot:xSquaredPlot]; 

CPPlotSymbol *greenCirclePlotSymbol = [CPPlotSymbol ellipsePlotSymbol]; 
greenCirclePlotSymbol.fill = [CPFill fillWithColor:[CPColor greenColor]]; 
greenCirclePlotSymbol.size = CGSizeMake(2.0, 2.0); 
xSquaredPlot.defaultPlotSymbol = greenCirclePlotSymbol; 

CPScatterPlot *xInversePlot = [[[CPScatterPlot alloc] 
           initWithFrame:graph.defaultPlotSpace.bounds] autorelease]; 
xInversePlot.identifier = @"X Inverse Plot"; 
xInversePlot.dataLineStyle.lineWidth = 1.0f; 
xInversePlot.dataLineStyle.lineColor = [CPColor blueColor]; 
xInversePlot.dataSource = self; 
[graph addPlot:xInversePlot]; 

}

  • (無效)didReceiveMemoryWarning { //發佈視圖,如果它不具有上海華。 [super didReceiveMemoryWarning];

    //發佈任何未使用的緩存數據,圖像等。 }

  • (void)viewDidUnload {super viewDidUnload]; //發佈主視圖的任何保留子視圖。 //例如self.myOutlet = nil; }

  • (void)dealloc {super dealloc]; }

@end