I am working on 开发者_如何学运维an application for the Mac App Store. Unlike iOS, Mac applications leverage Garbage Collection.
My question is, do I need to worry about memory leaks in Mac app development or is it good practice to clean it yourself like you do in iOS?
Unlike iOS, Mac applications leverage Garbage Collection.
Did you turn on the garbage collection in the compiler setting? Note that it is an opt-in technology. If you don't, you have to do retain/release.
If you do turn on the garbage collection, memory management is automatically done for you, as long as you only use Cocoa objects. Core Foundation objects are not automatically taken care of, so you need some care if you use CF...
methods.
For more on garbage collection, read the official documentation.
精彩评论