Anyway to get string from variable name?
Posted
by hacksigal
on Stack Overflow
See other posts from Stack Overflow
or by hacksigal
Published on 2010-03-20T21:07:19Z
Indexed on
2010/03/20
21:11 UTC
Read the original article
Hit count: 163
objective-c
|nsstring
Say I have my class
@interface Person : NSObject { NSString *name; }
I need to get the name of NSString's within my class
Person *person = [[Person alloc] init];
NSLog(@"Name of variable %s\n", NameofVariable(person.name));
© Stack Overflow or respective owner