我已在视图控制器中实现了代理CPTPlotDataSource
和CPTPlotSpaceDelegate
。我还设置了plotSpace.allowsUserInteraction = YES
和self.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
。
我的代码中遗漏了什么?
谢谢!
答案 0 :(得分:4)
我忘了设置我的委托:plotSpace.delegate = self;