【发布时间】:2015-05-13 13:14:31
【问题描述】:
我正在分析我的应用程序并遇到以下错误。有人可以帮帮我吗?
- (id)initWithLayer:(id)layer
{
self = [super initWithLayer:layer];
if (self)
{
[self setDefaults];
MCNewCustomLayer *other = (MCNewCustomLayer*)layer;
self.value = other.value;
self.textLabel = other.textLabel;
self.selectionStatus = other.selectionStatus;
self.animationDuration = other.animationDuration;
self.mainPath = CGPathCreateMutableCopy(other.mainPath);
self.fillColor = CGColorCreateCopy(other.fillColor);
self.strokeColor = CGColorCreateCopy(other.strokeColor);
self.mainPathImage = other.mainPathImage;
self.identifier = other.identifier;
self.parentLayeredView = other.parentLayeredView;
self.isAllowedToAnimate = other.isAllowedToAnimate;
self.imageBoundsStyle = other.imageBoundsStyle;
self.isPresentationLayer = YES;
}
return self;
}
警告信息是这样的:
假设 'self' 不为零
调用函数 'CGPathCreateMutableCopy' 会返回一个具有 +1 保留计数的 Core Foundation 对象
对象泄露:分配的对象在此执行路径的后面没有被引用,并且保留计数为 +1
【问题讨论】:
-
我认为您想将对象桥接到 ARC。
标签: ios objective-c