是否无法以编程方式调用Delegate Methods?

Kin*_*Kin 2 xcode delegates core-plot

我想问一下是不可能以编程方式调用Delegate Methods?我想在核心绘图库中手动调用Axis Delegate Methods来在一些自动缩放后更新我的轴.

-(BOOL)axis:(CPTAxis *)axis shouldUpdateAxisLabelsAtLocations:(NSSet *)locations
Run Code Online (Sandbox Code Playgroud)

我不想创建另一个方法来调用,因为它与轴委托执行相同的工作.如何手动调用代理?

Gre*_*ill 7

你可以像任何其他方法一样,没有关于委托方法的"特殊".

[self axis:axis shouldUpdateAxisLabelsAtLocations:locations];
Run Code Online (Sandbox Code Playgroud)

假设您有变量axis并且locations包含您想要传递的信息.