3

Xcode 5 を使用していますが、Core Plot を使用する iOS アプリをコンパイルしようとすると、次のエラーが発生します。

Implicit conversion from enumeration type 'enum UILineBreakMode' to different enumeration type 'NSLineBreakMode' (aka 'enum NSLineBreakMode')

エラーは次の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();
}

このエラーを修正するにはどうすればよいですか?

4

2 に答える 2

8

これは、Core Plot の新しいバージョンで修正されています。それまでの間、問題の定数を に変更しNSLineBreakByWordWrappingます。

于 2013-09-03T23:33:27.433 に答える