views:

188

answers:

5

Today I tried to compile a project with CorePlot.

All the time I get the following errors:

  ".objc_class_name_NSNotificationCenter", referenced from:
 literal-pointer@__OBJC@__cls_refs@NSNotificationCenter in libCorePlot.a(CPGraph.o)
 literal-pointer@__OBJC@__cls_refs@NSNotificationCenter in libCorePlot.a(CPXYPlotSpace.o)
 ".objc_class_name_NSException", referenced from:
 literal-pointer@__OBJC@__cls_refs@NSException in libCorePlot.a(CPScatterPlot.o)
 literal-pointer@__OBJC@__cls_refs@NSException in libCorePlot.a(CPBarPlot.o)
 literal-pointer@__OBJC@__cls_refs@NSException in libCorePlot.a(CPGraph.o)
 literal-pointer@__OBJC@__cls_refs@NSException in libCorePlot.a(CPGradient.o)
 literal-pointer@__OBJC@__cls_refs@NSException in libCorePlot.a(CPLayer.o)
 literal-pointer@__OBJC@__cls_refs@NSException in libCorePlot.a(CPXYPlotSpace.o)
 literal-pointer@__OBJC@__cls_refs@NSException in libCorePlot.a(CPTheme.o)
 literal-pointer@__OBJC@__cls_refs@NSException in libCorePlot.a(CPTradingRangePlot.o)
 literal-pointer@__OBJC@__cls_refs@NSException in libCorePlot.a(CPAxisLabel.o)
 literal-pointer@__OBJC@__cls_refs@NSException in libCorePlot.a(CPAxisTitle.o)
 literal-pointer@__OBJC@__cls_refs@NSException 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:
 literal-pointer@__OBJC@__cls_refs@NSMutableArray in libCorePlot.a(CPPlot.o)
 literal-pointer@__OBJC@__cls_refs@NSMutableArray in libCorePlot.a(CPScatterPlot.o)
 literal-pointer@__OBJC@__cls_refs@NSMutableArray in libCorePlot.a(CPBarPlot.o)      [ . . . ]

I hope someone can help me.

EDIT: It's working if I try to compile for device but not for simulator.

A: 

I missed including the headerfiles of framework by setting header search path in projectsettings. => double-click Target => bild => search for Header Search Path set values to: recursiv = YES search and ../framework/

It should look like this: alt text alt text

Download framework here: http://code.google.com/p/core-plot/downloads/detail?name=alpharelease_0.1.zip&can=2&q=

Copy framework folder next to project's folder.

Andreas Prang
A: 

Where does the recursive = YES part go?? I can't find that anywhere in the settings either for target or project. Please help, my app, which follows up through the first few steps of the SOTC tutorial compiles with 130 errors!

Any help is appreciated!

Arash
I did upload two pic's. They should help.
Andreas Prang
A: 

You guys rock!! I went from 130 errors compile time to just 1. Now it just says it can't find the Library -lCorePlot which I have included in the 'other linker flags' section of the project build settings.

I did download the framework from the link in the post above and it is in the same directory as the project folder and the header path has been set to recursive and the path is now '../framework/**'

Any ideas?

Thanks! ~Arash

Arash
At first: Which file you downloaded? You should try this one: http://code.google.com/p/core-plot/downloads/detail?name=alpharelease_0.1.zip-) examples and rebuild the samples implementation of CorePlot. This was the way got success. Think about the different buildpaths one level up!
Andreas Prang
That is the file I downloaded, I just never saw the examples folder :-). Thanks for pointing this out, I'm not sure what I was missing on my test app but by using and testing with these samples, I should be able to figure it out.
Arash
A: 

I seem to have fixed the problem i was having earlier, but to my best guess it was only fixed by adding the rest of the code, it might still be there hidden behind these 7 other errors. I have attached the complete view controller.m file for more experienced eyes.

//

// SOTC_CorePlotViewController.m // SOTC-CorePlot // // Created by NFCU 98972 on 8/18/10. // Copyright 2010 MyCompanyName. All rights reserved. //

import "SOTC_CorePlotViewController.h"

@implementation SOTC_CorePlotViewController

-(NSUInteger)numberOfRecords { return 51; }

-(NSNumber *)numberForPlot:(CPPlot *)plot field:(NSUInteger)fieldEnum
recordIndex:(NSUInteger)index { double val = (index/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]; } } }

// Implement viewDidLoad to do additional setup after loading the view, typically from a 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];

}

  • (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning];

    // Release any cached data, images, etc that aren't in use. }

  • (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; }

  • (void)dealloc { [super dealloc]; }

@end

Arash
A: 

Alright guys, sorry for the post blastinng, I have fixed my other 7 issues by going through the comments on the original SOTC post. The only problem I am having now is that when the project runs it brings up a white screen and nothing else. This was alluded to in the comments but no solution was provided:

Sorry about the compile-time problems you're having. That's the problem with a framework at this stage, the APIs tend to change rapidly. In the case of the warning you're getting, you'll need to change

-(NSUInteger)numberOfRecords { in the above code to the new

-(NSUInteger)numberOfRecordsForPlot:(CPPlot *)plot { definition.

The white screen you're seeing may be due to the fact that the delegate method is missing and therefore won't report back how many data points need to be plotted.

If you have additional questions, I recommend posting them to the Google Group for this project at http://groups.google.com/group/coreplot-discuss?hl=en

Blockquote

Thanks for any help, ~Arash

Arash