我想创建一个按钮,突出显示散点图中当前突出显示的点之后的下一个点。
我应该在按钮的 addTarget 中调用方法 -(void)scatterPlot:(CPTScatterPlot *)plotplotSymbolWasSelectedAtRecordIndex:(NSUInteger)index 吗?或者有什么解决办法?
我尝试这样做,但它不起作用。我收到此错误“NSInvalidArgumentException”,原因:“-[GraficViewController scatterPlot:aaplPlot:plotSymbolWasSelectedAtRecordIndex:ind:]:无法识别的选择器发送到实例 0x2c2e80”。
UIButton * button = [[UIButton alloc] initWithFrame:CGRectMake(100, 100, 100, 50)];
[button setImage:[UIImage imageNamed:@"grafic-info-button.png"] forState:UIControlStateNormal];
[self.view addSubview:button];
int ind = selectedIndex + 1;
[button addTarget:self action:@selector(symbolforScatterPlot:aaplPlot: recordIndex:ind:) forControlEvents:UIControlEventTouchUpInside];
最佳答案
在选择器按钮列表器上,使用 Core Plot 添加分散突出显示选项。
关于ios - 如何创建一个按钮,突出显示散点图中的下一个点? ios,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15739824/