I\'ve implemented an save on applicationWillTerminate and load on applicationWillFinishLoading. There is a complete object tree, all implement the
applicationWillTerminate
applicationWillFinishLoading
For the bool and int, there are two methods: encodeBool:forKey: and encodeInt:forKey: (taken from the NSKeyedArchiver reference).
encodeBool:forKey:
encodeInt:forKey:
For the NSMutableData, you should archive them with encodeObjectForKey: and unarchive them with decodeObjectForKey:.
encodeObjectForKey:
decodeObjectForKey:
You can refer to this useful guide for more cases.