coreplot吧点击不工作

Jac*_*ood 2 bar-chart core-plot ios ios5 ios6

我从Github下载了这段代码:https://github.com/gilthonweapps/CorePlotBarChartExample. 如何选择onTap for bar?我使用以下代码:

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

     NSLog(@"barWasSelectedAtRecordIndex %d", index);
}
Run Code Online (Sandbox Code Playgroud)

但这不起作用(它没有认识到Tap).请帮助.谢谢你提前和新年快乐.

Eri*_*och 5

将绘图设置为delegate条形图委托对象.这通常是视图控制器,但并非必须如此.