During development of Citihaiq we spent a lot of energy manually writing support for NSCoder into various classes. After a while it came to me that statefulness of an iPhone app should be easy. I did a bit of digging into the reflection system of Objective-C and came up with a 90% solution. Basically you inherit from a class supplied by my library and name all members you want to be stateful by naming them with the prefix “stateful_” and now all you have to do is save and load state with two simple method calls when it is appropriate. Versioning and timeout for state is included.
More details can be found at the project page on google code.
- Möller