Is there a way to loop through all properties in an object and get their “name” and “value”.
I am trying to write a category to serialize objects to a string, based on their property name and values. I’m trying to prevent writing encoding methods for each class, and instead write a generic one.
Is this possible?
You can use this code to enumerate all properties declared in a class, and all attributes of the properties. I guess you’re more interested in parsing the type attribute. They are detailed here.