I see that the 2.0 beta supports ARC. I tried enabling it in 1.x, and it was very frustrating, and I eventually gave up. Before I look into it again, I'd like to know the community's opinion on using it. Managing memory doesn't seem to be that difficult with Instruments to help find memory leaks. Does ARC provide you any value?
So, who's using ARC?(4 posts) (4 voices)
The most recent version of cocos2d v1.1 (from github) also is compatible with ARC.
And by compatible I mean that if your project uses ARC, then you can include the cocos2d sources following these instructions http://www.tinytimgames.com/2011/07/22/cocos2d-and-arc/
You should use ARC if you find the ARC code easier to maintain. There are people that prefers to use ARC, and people that find it easier to maintain the manual retain-release model.
ARC is not real garbage collection for sure. It imposes a few annoying restrictions, doesn't solve retain cycles, and requires extra type annotation. Manual memory management is pretty easy to do, but easy to make mistakes too. It doesn't particularly make the code that much easier to write the first time, but I'm hoping that it saves on debugging time later by cutting down on hard to find issues like dangling pointers, memory leaks and double frees.
I think it's pretty clear that ARC will be the way to write Cocoa code going forward. The GC on Mac OS X is all but dead and ARC is the only alternative that Apple is offering to provide similar functionality.
I will likely give ARC a shot in my next project; the prospect of converting my application at this point scares me. Even with the automatic re-factor menu option. But this definitely will save a few headaches for some people. Can't tell you have many hours I've spent trying to find out why object X has a retain count of X still.
You must log in to post.