NSCoding, archiving
Essence
Archiving is serializing an object graph into NSData and back with NSKeyedArchiver/NSKeyedUnarchiver. For a class to be archivable it implements the NSCoding protocol:
-encodeWithCoder:(NSCoder *)coder— write the state by keys;-initWithCoder:(NSCoder *)coder— restore it.
NSCoder is the abstract "coder" class; the keyed archiver writes key → value pairs, which lets the set of fields change between versions (old keys are simply ignored, missing new ones make decodeObjectForKey: return nil). This is how UIViews are stored in storyboards/XIBs, state restoration, NSUserDefaults for non-standard types, on-disk caches.
The rest of this answer, with code and interview follow-ups, is in the DevPrep app.
Read the full answer in DevPrep