I am using Xcode 5 and get the following error when trying to compile my iOS app which uses Core Plot:
Implicit conversion from enumeration type 'enum UILineBreakMode' to different enumeration type 'NSLineBreakMode' (aka 'enum NSLineBreakMode')
The error is in CPTTextStylePlatFormSpecific.m:
-(void)drawInRect:(CGRect)rect withTextStyle:(CPTTextStyle *)style inContext:(CGContextRef)context
{
if ( style.color == nil ) {
return;
}
CGContextSaveGState(context);
CGColorRef textColor = style.color.cgColor;
CGContextSetStrokeColorWithColor(context, textColor);
CGContextSetFillColorWithColor(context, textColor);
CPTPushCGContext(context);
UIFont *theFont = [UIFont fontWithName:style.fontName size:style.fontSize];
[self drawInRect:rect
withFont:theFont
lineBreakMode:**UILineBreakModeWordWrap** // ERROR!!
alignment:(NSTextAlignment)style.textAlignment];
CGContextRestoreGState(context);
CPTPopCGContext();
}
How can I fix this error?
This is fixed in newer versions of Core Plot. In the meantime, change the offending constant to NSLineBreakByWordWrapping.
That should only be a warning, unless you've turned on -Werror (not a bad idea). Regardless, if you looked at the autocomplete for "NSLineBreak," which the error implies you should, you would see NSLineBreakByWordWrapping.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With