我根據README文件安裝了所有東西,並導入了所有必需的庫。不過,實施這種方法時:ARC與CorePlot問題
- (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];
}
我收到錯誤:
ARC Semantic issue - Receiver 'CPTTextLayer' for class message is a forward declaration
和 ARC Semantic issue - Receiver 'CPTTextLayer' for instance message is a forward declaration
我在很多帖子閱讀,這是缺少Quartz庫的錯,但我有它在項目中導入幷包含在課程中:#import <QuartzCore/QuartzCore.h>
。
當我返回nil
而不是這樣,一切正常,但嘿,我需要這些數據標籤工作!
任何人都知道如何使它工作?
你試過導入CPTTextLayer.h嗎? – borrrden
我沒有想到**那** ......爲什麼Xcode不向我大聲說它需要導入? – Michal
這樣做,你只是不明白的消息:第 – borrrden