2013-10-08 1 views
2

CorePlot 1.4를 (종속 프로젝트 설치)에 통합하려는 iOS7 응용 프로그램이 있습니다.CorePlot이 iOS7 app/Xcode5에서 예외를 throw합니다.

@property (nonatomic) CPTGraphHostingView *hostingView; 

_hostingView = [[CPTGraphHostingView alloc] initWithFrame:CGRectNull]; 

(_hostingView는 자동 레이아웃이 적용됩니다.) 그때 그래프에 추가하는 경우 :

-[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 
: 내가 처음이 예외가

CPTXYGraph *graph = [[CPTXYGraph alloc] initWithFrame:CGRectZero]; 
_hostingView.hostedGraph = graph; 

필사적으로 나는 근래 전자는 그때까지 updateAxisLabelsAtLocations:inRange:useMajorAxisLabels이 고정 :

NSDictionary *textAttributes = nil; 
BOOL hasAttributedFormatter = FALSE; 

하고 다음 예외를 얻을 :

-[__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 
코드 아래 주석으로 고정 3,516,

:

else { 
    // [myText drawInRect:newBounds 
    //  withTextStyle:self.textStyle 
    //   inContext:context]; 
    } 

이제 마지막 예외가 발생되지 않고, 그래프 테두리를 나타낸다. 그러나 데이터/범례 등을 추가하기 시작하면 새로운 예외가 throw됩니다. (

물론 코드에 주석이 없기 때문에 텍스트가 표시되지 않습니다. 그러나 이러한 예외가 ? 던진 나는 필사적; S

내가 통합에 근본적인 뭔가를 놓친하지만 내 통합 (하지만 CorePlot 1.3) 몇 시간 전에 Xcode4상의 iOS6의 응용 프로그램에서 잘 작동 것 같다

답변

6

을 확인합니다.. 응용 프로그램 프로젝트의 링커 플래그. 코어 플롯은 -ObjC-all_load이 필요합니다. 자세한 내용은 코어 플롯 wiki을 참조하십시오.

+0

감사합니다. Eric - 대단한 구호! 지금 어리석은 느낌 :) ARC를 사용하기 위해 CorePlot을 리팩토링 할 계획이 있습니까? –

+1

2.0 릴리스 (이미 브랜치에 있음)는 GC 지원을 중단하고 ARC를 사용합니다. 아직 출시 일정은 없습니다. –

관련 문제