我有一个实例变量CGMutablePathRef _mutablePath
,我设置为@property (nonatomic) CGMutablePathRef mutablePath;
. 我重写了setter方法:
- (void) setMutablePath:(CGMutablePathRef)mutablePath
{
if (_mutablePath)
{
CGPathRelease(_mutablePath);
_mutablePath = NULL;
}
_mutablePath = CGPathRetain(mutablePath);
}
但是我在这一行收到警告:上面_mutablePath = CGPathRetain(mutablePath);
写着:
Assigning to 'CGMutablePathRef' (aka 'struct CGPath *') from 'CGPathRef' (aka 'const struct CGPath *') discards qualifiers
为什么这行不通?当我这样做时,这似乎适用于 CT(核心文本)对象。我尝试了一堆不同的演员阵容,但无法让错误消失,任何建议都将不胜感激。