Iphone Game Programming - Tutorial 12 - Saving State

Posted on 23 December 2009 by mike

I've managed to squeeze in one last small tutorial for 2009. I had a request on the blog for a tutorial on saving game state. This is only a quicky and I've built it on the code from Tutorial 11. It covers how I've used NSCoding to store game state which is really easy to do.

Tutorial 12

Tutorial 12 Project

I hope you enjoy it and have a great Christmas :o)

Update 23/12/09: Kurt commented on the tutorial and pointed out that I am over retaining myObject when it is loaded from the decoder. As I am using self.myObject and the property is defined as retain, doing a further retain when reading it in would in fact leak myObject. I have changed the source code and removed the unnecessary retain. I don't use self in the SLQ code and hence need the retain. More haste less speed they say :o)

Mike

blog comments powered by Disqus