【问题标题】:Isn't possible to call Delegate Methods programmatically?不能以编程方式调用委托方法吗?
【发布时间】:2012-03-19 20:14:43
【问题描述】:

我想问一下不能以编程方式调用委托方法吗? 我想手动调用核心绘图库中的轴委托方法,以在一些自动缩放后更新我的轴。

-(BOOL)axis:(CPTAxis *)axis shouldUpdateAxisLabelsAtLocations:(NSSet *)locations

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

【问题讨论】:

    标签: xcode delegates core-plot


    【解决方案1】:

    你可以像任何其他方法一样做这一切,委托方法没有什么“特别”的地方。

    [self axis:axis shouldUpdateAxisLabelsAtLocations:locations];
    

    假设您有变量 axislocations 包含您要传递的信息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-07-01
      • 1970-01-01
      • 2021-10-18
      • 2011-09-29
      • 2013-02-23
      • 1970-01-01
      • 1970-01-01
      • 2012-04-07
      相关资源
      最近更新 更多