I have an Objective-C class that implements NSCoding. I need to return a representation of an instance of this class in the form of an NSDictionary, where the keys are the property names and the values are the property values.
How do I make this conversion in Objective-C ?
It should be straightforward to create an
NSCodersubclass, whoseencode<thing>:forKey:methods just stick thethings into a dictionary, which you can then retrieve.Then you create an instance of your coder, and send
encodeWithCoder:to this object you want in a dictionary.