For tomorrow’s launch of KoboldTouch I made a quick 6-minute presentation about KoboldTouch and what makes it special.
UPDATE: KoboldTouch is now available!
Not everything made it into the presentation. There’s a couple things that may be worth adding or stressing:
First of all, ARC. Seriously, if you’re not using ARC today, right now, you’re doing yourself a HUGE disservice. KoboldTouch does not only allow you to write ARC code, KT itself is written using ARC. You’ll see how much cleaner code gets when you don’t have to consider release, autorelease or retain anymore.
Secondly, zeroing weak references are a fundamental aspect of KoboldTouch development. It makes it so easy to avoid retain cycles, and it makes a couple things easier for you too. For example, if you forget to unregister a delegate - it doesn’t matter! KT classes providing a delegate property declare the delegate as weak reference, so there won’t be a crash if you don’t unregister, and in fact you don’t have to unregister delegates at all.
Classes that can have multiple delegate will clean up the delegates when a scene change occurs. Again this is to prevent crashes or leaks due to accidentally forgetting to unregister a delegate.
Lastly, zeroing weak references enable KoboldTouch to actually catch and warn about a memory leak! If shortly after a scene change the previous scene’s reference hasn’t been nil’ed automatically, KoboldTouch knows that the scene is still in memory for whatever reason. This will raise an exception, and then you know about the leak when it first occurs. It’s a lot easier to figure out and fix the cause for such a leak when you’re still aware of the changes you did most recently.
Follow @gaminghorror | Follow @kobold2d |
|
Hi,
launch time?
2-3 hours from now. Still uploading files.
I’m so excited! This looks like a very big time saver. While I’m here, I have a quick question. I’m using the newest CocosBuilder (2.1) to help with level construction for a game world that spans far beyond the screenSize, but is not a parallax scroll. I’m also using Kobold. To push the very first scene I need to use [CCBReader sceneWithNodeGraphFromFile:@”..”]. With Kobold, the call to push the initial scene is tucked away in the config.lua. How would I go about initializing the first scene with CCBReader while using Kobold?
You can add this to the AppDelegate’s initializationComplete method. If a scene is already setup and running after this method completes, it will not try to load the scene specified in the config.lua.
Ah, I knew I was missing something. Many thanks.