Example ARC project. Pretty awesome.

When I wrote the tutorial how to enable ARC for a cocos2d project, I neglected to include an actual working project. I mean why read and follow a long tutorial if all you really need is a working project to get started with?

Therefore I decided to enable ARC in all twelve standard cocos2d Xcode project templates for both cocos2d versions (v1.1 and v2.0), both platforms (iOS and Mac OS), both physics engines (Box2D and Chipmunk) and publish them on github.

You can download the ARC-enabled cocos2d template projects either as ZIP file or TAR file.

How to use the Cocos2D ARC Template Projects?

This is really simple. The cocos2d version (v1.x or v2.x), the target platform (iOS or Mac) and the physics engine (Box2D, Chipmunk or none) are coded into each project’s name. For example cocos2d-2.x-Chipmunk-Mac includes cocos2d-iphone v2.0 and the Chipmunk physics engine targetting the Mac OS X platform.

1. Make a copy of the desired project’s folder
2. Open the .xcodeproj in Xcode.
3. (optional) Rename the project to your liking.
4. Start writing ARC code with cocos2d.

That’s all. Enjoy the summer! Stay inside where it’s cool (relatively) and dark (mandatory). :)

This article was brought to you by ...

I very much enjoy the learning process, the pushing of boundaries (mine and yours and that of technology), having the freedom to pursue whatever is on my mind, to boldly program what no one has programmed before, and to write about what I've learned. Help me help you by browsing the products in the Learn Cocos2D Store.

14 Responses to “All The Cocos2D Xcode Project Templates With ARC Enabled”

  1. Gary Ash says:

    Thanks, you’ve save me (and others I’m sure) a lot of time and hassle

  2. mini says:

    Hi Steffen,

    Is it easy enough to convert IOS project to storyboards?

    I tried few tutorials but there are lot of compiling errors ,Do you have any advice for me?

  3. Bryan says:

    So are these templates fairly easy to convert/install into actual Xcode templates? I’m not sure where to begin there, I’m a Visual Studio guy just learning Xcode.

    • No. Xcode templates are a beast. Even a simple template can take hours to create from scratch. Cocos2D for example relies on a script to create their template projects, because once your project has a dozen files or more, it becomes a nuisance to create and update Xcode templates.

      If you’re really interested check out the documentation I wrote on Xcode template creation: http://www.learn-cocos2d.com/store/xcode4-template-documentation/

      But you don’t really need Xcode templates. Whether you create a new project from within Xcode, or copy an existing project and rename it is essentially the same thing, and it takes barely any additional time or effort to do the latter.

  4. David says:

    Any progress with the tutorial? I’ve spent the past few hours trying tutorials and failing, I’m after ARC, Cocos2D 2.x and Storyboards, targeting iOS 6 as a minimum preferably.

    Cheers, David.

  5. Vincent Moore says:

    When I build with your templates the aurto rotation does not work. I did not edit the project whatsoever but once I build it the orientation stays in portait. When I rotate the iPhone simulator the orientation stiil stays the same. I checked the app delegate.m file and made sure landscape was the only setting I had in the project settings but yet the simulator is rotated but the scene remains in portrait. Any ideas on why this is happening and anyway to fix it?

    • May be the old issue with cocos2d 2.0 and iOS 6. Upgrading to v2.1 might help.

      • Vincent Moore says:

        Would i still be following your other blog on how to enable ARC for “cocos2d-2.1”? And if so, when I enable Arc, can i just save the project with no edits the same way you did with these so I can easily copy the folder later on, rename the project, and write my programs?

        • Either that or read the post about updating cocos2d.

          Yes, definitely make a copy of the entire project folder so you can keep reusing the project.

          • Vincent Moore says:

            Thanks. I just updated cocos2d and followed your tutorial on enabling ARC. Now I use those as templates.