I am new to Swift and am wondering if anyone can anyone help confirm my understanding with releasing objects in Apple's Swift?
The documentation for CGPathCreateWithRect()
described here states that the return value is
"A new, immutable path. You are responsible for releasing this object."
When is says "you are responsible" is it as simple as saying that when you no longer hold a reference the garbage collector will delete the object? I.e. you are responsible for managing the references? In which case - isn't that obvious? If not - what does it mean?
Thanks
Bryon
You are responsible only when using Objective-C
From the Swift documentation
Memory Managed Objects
Core Foundation objects returned from annotated APIs are automatically memory managed in Swift—you do not need to invoke the CFRetain, CFRelease, or CFAutorelease functions yourself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With