CorePlot在iOS7应用程序/Xcode5中引发异常

CorePlot在iOS7应用程序/Xcode5中引发异常,ios7,core-plot,xcode5,Ios7,Core Plot,Xcode5,我有一个iOS7应用程序,我正试图将CorePlot 1.4集成到其中(依赖项目安装) 及 (\u hostingView受自动布局影响。)如果我随后添加一个图形: CPTXYGraph *graph = [[CPTXYGraph alloc] initWithFrame:CGRectZero]; _hostingView.hostedGraph = graph; 我首先得到一个例外: -[CPTTextStyle attributes]: unrecognized selector sent

我有一个iOS7应用程序,我正试图将CorePlot 1.4集成到其中(依赖项目安装)

\u hostingView
受自动布局影响。)如果我随后添加一个图形:

CPTXYGraph *graph = [[CPTXYGraph alloc] initWithFrame:CGRectZero];
_hostingView.hostedGraph = graph;
我首先得到一个例外:

-[CPTTextStyle attributes]: unrecognized selector sent to instance 0xa392900
 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CPTTextStyle attributes]: unrecognized selector sent to instance 0xa392900'
5   myapp                     0x00074325 -[CPTAxis updateAxisLabelsAtLocations:inRange:useMajorAxisLabels:] + 1141
6   myapp                     0x00075662 -[CPTAxis relabel] + 1202
-[__NSCFString sizeWithTextStyle:]: unrecognized selector sent to instance 0x9591e90
 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString sizeWithTextStyle:]: unrecognized selector sent to instance 0x9591e90'
5   myapp                     0x00081520 -[CPTTextLayer sizeThatFits] + 320
6   myapp                     0x0008163c -[CPTTextLayer sizeToFit] + 108
7   myapp                     0x00080559 -[CPTTextLayer initWithText:style:] + 313
8   myapp                     0x00074b87 -[CPTAxis updateAxisLabelsAtLocations:inRange:useMajorAxisLabels:] + 3159
9   myapp                     0x00075672 -[CPTAxis relabel] + 1202
在绝望中,我通过以下方式在更新AxisLabelsLocations:inRange:UseMayorAxisLabels中修复了此问题:

NSDictionary *textAttributes = nil;
BOOL hasAttributedFormatter  = FALSE;
然后获取下一个异常:

-[CPTTextStyle attributes]: unrecognized selector sent to instance 0xa392900
 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CPTTextStyle attributes]: unrecognized selector sent to instance 0xa392900'
5   myapp                     0x00074325 -[CPTAxis updateAxisLabelsAtLocations:inRange:useMajorAxisLabels:] + 1141
6   myapp                     0x00075662 -[CPTAxis relabel] + 1202
-[__NSCFString sizeWithTextStyle:]: unrecognized selector sent to instance 0x9591e90
 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString sizeWithTextStyle:]: unrecognized selector sent to instance 0x9591e90'
5   myapp                     0x00081520 -[CPTTextLayer sizeThatFits] + 320
6   myapp                     0x0008163c -[CPTTextLayer sizeToFit] + 108
7   myapp                     0x00080559 -[CPTTextLayer initWithText:style:] + 313
8   myapp                     0x00074b87 -[CPTAxis updateAxisLabelsAtLocations:inRange:useMajorAxisLabels:] + 3159
9   myapp                     0x00075672 -[CPTAxis relabel] + 1202
然后,我通过在
sizeThatFits
中注释掉这一行来“修复”这一问题:

    else {
     //   textSize = [myText sizeWithTextStyle:self.textStyle];
    }
下一个例外是:

-[__NSCFString drawInRect:withTextStyle:inContext:]: unrecognized selector sent to instance 0xa162bd0
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString drawInRect:withTextStyle:inContext:]: unrecognized selector sent to instance 0xa162bd0'
5   myapp                     0x00081dc8 -[CPTTextLayer renderAsVectorInContext:] + 1144
6   myapp                     0x00063f60 -[CPTLayer drawInContext:] + 112
通过在
renderAsVectorInContext
中注释下面的代码来修复此问题:

    else {
     //   [myText drawInRect:newBounds
     //        withTextStyle:self.textStyle
     //            inContext:context];
    }
现在,最终不会抛出异常,并显示图形边框。但如果我随后开始添加数据/图例等,则会引发新的异常:(

轴上没有显示任何文本等。当然,这是因为我已经注释掉了代码。但是有任何线索说明为什么会抛出这些异常吗?我很绝望;S


似乎我在集成中遗漏了一些基本的东西。但是我的集成(尽管是CorePlot 1.3)不久前,在Xcode4上的iOS6应用程序中运行良好。

检查应用程序项目中的链接器标志。Core Plot需要
-ObjC
-all\u load
。有关更多信息,请参阅Core Plot。

谢谢Eric-非常轻松!现在感觉很愚蠢:)有计划重构CorePlot以使用ARC吗?2.0版本(已经在一个分支中)将放弃GC支持并使用ARC。目前还没有发布的时间表。