我有这个代码:
CGPathRef cgPath = [path quartzPath];
self.blackLine.path = cgPath;
self.whiteDashes.path = cgPath;
CGPathRelease(cgPath);
我们将 CAShapeLayers (self.blackLine和self.whiteDashes) 路径设置为此CGPathRef
然后立即释放路径
但是为什么shapelayers仍然绘制正确的路径?当您分配path财产时,它会复制吗?还是与reforreference后缀有关?