So, who's using ARC?

Forums Programming cocos2d support (graphics engine) So, who's using ARC?

This topic contains 3 replies, has 4 voices, and was last updated by  GarrettVD 2 years, 4 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
Author Posts
Author Posts
November 29, 2011 at 11:54 pm #237330


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?

November 30, 2011 at 12:14 am #357114


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

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.

November 30, 2011 at 12:44 am #357115


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.

November 30, 2011 at 1:10 am #357116


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.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.