我有這樣的代碼:即使CGPathRef已發佈,CAShapeLayer如何繼續在路徑(CGPathRef)上繪圖?
CGPathRef cgPath = [path quartzPath];
self.blackLine.path = cgPath;
self.whiteDashes.path = cgPath;
CGPathRelease(cgPath);
我們設置CAShapeLayers(self.blackLine
和self.whiteDashes
)路徑此CGPathRef
然後立即釋放路徑
但爲什麼在shapelayers仍然得出正確的路徑?當您指定path
屬性時,它是否創建副本?或者它是否與ref
或reference
鍵後綴有關?