I would like to be able to use reflection on a classes within Objective C to determine what properties are available at run time.
I do something similar for classes right now using
NSString *str = NSStringFromClass([object class]);
What I would like to do is use this result to go back to the class and see what properties are available as well as what type these properties are.
May be this will help:
You can get the list of properties in a class using class_copyPropertyList
objc_property_t * class_copyPropertyList(Class cls, unsigned int *outCount)
and then from each property, you can get the property name using property_getName
function and the property attributes using the property_getAttributes
function (if you need to filter read-write properties).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With