ios - Swift: CGPathRelease and ARC -


just updated xcode beta 4, , noticed following compiler error code below:

var path = cgpathcreatemutable() ... cgpathrelease(path) 

'cgpathrelease' unavailable: core foundation objects automatically memory managed

so remove release calls , should fine? or there more i'm missing? , there special cases should aware of arc?

the working cocoa data types section of using swift cocoa , objective-c says (emphasis mine):

core foundation objects returned annotated apis automatically memory managed in swift—you not need invoke cfretain, cfrelease, or cfautorelease functions yourself. if return core foundation objects own c functions , objective-c methods, annotate them either cf_returns_retained or cf_returns_not_retained.

when swift imports apis have not been annotated, compiler cannot automatically memory manage returned core foundation objects. swift wraps these returned core foundation objects in unmanaged<t> structure.

so yes, unless have unmanaged struct, correct , don't have worry manually releasing object.


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -