I\'m storing a bunch of data in a .plist file (in the application documents folder), and it\'s structured like this:
Dictionary {
\"description\" = \"String
Instead of writing all that custom class junk, you should use NSPropertyListSerialization
. Specifically, see the propertyListWithData:options:format:error:
method. Example usage:
NSMutableDictionary *d = [NSPropertyListSerialization propertyListWithData:[NSData dataWithContentsOfFile:@"path/to/file"]
options:NSPropertyListMutableContainers
format:NULL
error:NULL];
This will make all the containers mutable, but keep the leaf nodes (e.g. NSStrings) immutable. There's also an option to make the leaves mutable too.