I tried out implementing archiving as was taught in the book. I’m not sure that this is a good way because I tried it on a project. I did get an XML file from archiving, but when I looked at the XML file, it seemed to me that this whole method of archiving and unarchiving is fragile. What happens if I change a module name, or a class name. Wouldn’t this break my file formats?
Instead of using NSCoding, NSCoder, and NSKeyed archiver, I’m implementing XML parsing using NSXMLParser. So far, it seems better to me since the files are easier to understand, which is one thing that’s good about XML over older formats, such as binary. An XML file should be able to be opened up in a text editor and be understood by a human. My files are also shorter which isn’t the most important thing, but shorter files are better with other things being equal.
But the most important thing to me is that the file format doesn’t break when my code changes. What do you all think? Is NSCoding, NSCoder, and NSKeyed useful?