Cocos2D with a Touch of Cocoa

On May 31, 2011, in book, cocos2d, by Steffen Itterheim

When I asked on Twitter what kind of chapter you’d like to see in , I got some great responses! The most votes were for more complex physics examples, all other suggestions were all over the place. Saving and loading, optimizations and organizing bigger games, audio programming and Cocos3D. I think they would all deserve a chapter of their own, and in fact I’ll get you started with ObjectAL and Cocos3D in the chapter about Kobold2D.

But after some research I realized that one of the most frequent issues with an apparent lack in good answers are about integrating Cocoa Touch (UIKit) in a Cocos2D application. Or vice versa, adding Cocos2D to a Cocoa Touch application. There are many things to consider, and it’s easy to run into problems. This topic is especially persistant because on the one hand there are a lot of Cocoa Touch programmers who are starting to use Cocos2D, whereas there are also many Cocos2D users who know little of Cocoa Touch – and both want to use the best of both worlds.

Here’s a preliminary list of topics I’d like to get into:

  • RootViewController explained
  • Cocoa Touch views in a Cocos2D app (eg In-App Mail)
  • Starting & stopping Cocos2D in a Cocoa Touch app
  • Properly handling autorotation
  • Performance considerations
  • Adding iAd banners

If you have a suggestion that is not on this list feel free to add it in a comment!

Tagged with: