【问题标题】:warning: passing argument 1 of 'CGPathMoveToPoint' discards qualifiers from pointer target type警告:传递 'CGPathMoveToPoint' 的参数 1 会丢弃指针目标类型的限定符
【发布时间】:2011-03-08 01:54:21
【问题描述】:

我不断收到此警告 警告:传递 'CGPathMoveToPoint' 的参数 1 会丢弃指针目标类型的限定符

我是这样调用函数的

const CGAffineTransform m = CGAffineTransformIdentity;
CGPathMoveToPoint(path, &m , nextPos.x, nextPos.y);

我已经试过了

CGPathMoveToPoint(path, NULL , nextPos.x, nextPos.y);

CGAffineTransform m = CGAffineTransformIdentity;
CGPathMoveToPoint(path, &m , nextPos.x, nextPos.y);

但我总是得到这个错误,我该如何摆脱它?

【问题讨论】:

  • 显示path的声明。

标签: objective-c cocoa xcode warnings


【解决方案1】:

警告是关于论点 1,但您的所有变体都在论点 2 上。尝试更改论点 1,path — 可能是为了摆脱流氓const — 这应该可以解决问题。

【讨论】:

  • 大声笑,谢谢,这有点荒谬。是的,我开始了一个 CGPathRef,它应该是 CGMutablePathRef。非常感谢,我在网上爬了一段时间:P
猜你喜欢
  • 1970-01-01
  • 2013-03-02
  • 1970-01-01
  • 1970-01-01
  • 2011-03-19
  • 1970-01-01
  • 2011-03-29
  • 2016-08-12
  • 1970-01-01
相关资源
最近更新 更多