2013-01-01 84 views
2

我已经从Github下载此代码:https://github.com/gilthonweapps/CorePlotBarChartExample。如何获得onTap的酒吧选择?我正在使用以下代码:coreplot酒吧水龙头不工作

#pragma mark - CPTBarPlotDelegate methods 
-(void)barPlot:(CPTBarPlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)index { 

    NSLog(@"barWasSelectedAtRecordIndex %d", index); 
} 

但是,这是行不通的(它不承认Tap)。请帮助。 在此感谢提前和新年快乐。

+1

完整答案在这里:http://stackoverflow.com/questions/14121683/how-to-set-plot-delegate-in-coreplot/14122424#14122424。谢谢。 –

回答

5

将阴谋delegate设置为您的条形图委托对象。这通常是视图控制器,但它不一定是。

+0

谢谢Eric先生,但我该怎么做?你能解释一下吗?这将是一个很好的帮助。试着找出现在10多天。再次感谢。 –

+0

我已将CPTPlotSpaceDelegate更改为CPTBarPlotDelegate,并且存在问题:::从不兼容的类型'GraphView *'分配给'id ' –

+1

单个类可以实现多个协议。确保在类定义中列出了'CPTPlotSpaceDelegate'和'CPTBarPlotDelegate'。 –