Access property name (e.g. self.theProperty) in ObjC

Posted by Uroš Milivojevic on Stack Overflow See other posts from Stack Overflow or by Uroš Milivojevic
Published on 2010-03-24T08:19:00Z Indexed on 2010/03/24 8:23 UTC
Read the original article Hit count: 196

Filed under:

I'm trying to read property name but I'm not shore how. Is it possible in ObjC to get string "theProperty" from self.theProperty?

I know how to read all properties (with "class_copyPropertyList") and their names (with "property_getName") but couldn't find a way to do something like:

NSString *text = [self.theProperty somehowReadThePropertyName]; 
// expected result is: text == @"theProperty"

Any ideas?

© Stack Overflow or respective owner

Related posts about objective-c