objective-c - Core Plot 的 CPTPlotSpaceDelegate : Correct implementation of zooming and panning

标签 objective-c ios core-plot

我已经实现了代表CPTPlotDataSourceCPTPlotSpaceDelegate在我的 View Controller 中。我也设置了plotSpace.allowsUserInteraction = YESself.hostView.allowPinchScaling = YES .

然而,方法
-(BOOL)plotSpace:(CPTPlotSpace *)space shouldScaleBy:(CGFloat)interactionScale aboutPoint:(CGPoint)interactionPoint ,
-(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceDownEvent:(id)event atPoint:(CGPoint)point ,
-(CGPoint)plotSpace:(CPTPlotSpace *)space willDisplaceBy:(CGPoint)proposedDisplacementVector
-(CPTPlotRange *)plotSpace:(CPTPlotSpace *)space willChangePlotRangeTo:(CPTPlotRange *)newRange forCoordinate:(CPTCoordinate)coordinate即使绘图是可缩放的,也不会调用。

我在代码中遗漏了什么?

谢谢!

最佳答案

我确实忘记设置我的委托(delegate):plotSpace.delegate = self;

关于objective-c - Core Plot 的 CPTPlotSpaceDelegate : Correct implementation of zooming and panning,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11703165/

相关文章:

ios - CorePlot - 多行属性标签

objective-c - [NSFileManager copyItemAtPath :toPath:error:]: source path is nil

ios - NSOperationQueue添加后台线程操作

ios - 框架只能在模拟器上运行,不能在设备上运行

iphone - 如何添加多个不同形状的imageView?

ios - 当 x 轴变化时调整核心图中的 y 轴

objective-c - 核心图图表轴位置

iPhone全屏广告

objective-c - 我应该在 Objective C 类中的什么位置设置默认变量值

ios - 将按钮添加到 UIPickerView 以转到下一个数字