Reflection/List properties: Difference between revisions

m
(added objc)
Line 122:
const char *attributes = property_getAttributes(p);
// for simple types we can use Key-Value Coding to access it
// but in general we will have to use object_getIvarobjc_msgSend andto cast it tocall the right type of functiongetter,
// correspondingcasting objc_msgSend to the right type of function corresponding to the instancetype of the variablegetter
id value = [obj valueForKey:@(name)];
NSLog(@"%s\t%s\t%@", name, attributes, value);
Anonymous user