I installed everything according to README file and imported all necessary libraries. Still, when implementing this method:
- (CPTLayer *)dataLabelForPlot:(CPTPlot *)plot recordIndex:(NSUInteger)index {
CPTMutableTextStyle *labelText = nil;
labelText= [[CPTMutableTextStyle alloc] init];
labelText.color = [CPTColor grayColor];
return [[CPTTextLayer alloc] initWithText:@"Test" style:labelText];
}
I receive errors:
ARC Semantic issue - Receiver 'CPTTextLayer' for class message is a forward declaration
and
ARC Semantic issue - Receiver 'CPTTextLayer' for instance message is a forward declaration
I read in many posts, that this is the fault of missing Quartz library, though I have it imported in the project and included in the class: #import <QuartzCore/QuartzCore.h>.
When I return nil instead of this, everything works, but hey, I need those data labels to work!
Anybody knows how to make it work?
Normally
forward class errorcomes when that particular class is not imported in the current class and an@classis declared in .h file. If@classis also not present, it normally gives anunknown type error. So in this case as mentioned in comments, it is clear that the import statement forCPTTextLayeris missing.