我是 Swift 的新手,想知道是否有人可以帮助确认我对在 Apple 的 Swift 中释放对象的理解?
CGPathCreateWithRect()
的文档描述了 here说明返回值为
"A new, immutable path. You are responsible for releasing this object."
什么时候说“你负责”是不是就像说当你不再拥有一个引用时垃圾收集器将删除该对象一样简单? IE。您负责管理引用资料?在这种情况下 - 这不是很明显吗?如果不是 - 这是什么意思?
谢谢
拜伦
最佳答案
只有在使用 Objective-C 时,您才有责任
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.
关于ios - 在 Swift 中释放对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34673900/