Created
July 8, 2020 01:14
-
-
Save jebai0521/2a3f3c4d228bac4adac25bae393a4f70 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSArray *)objectProperties:(NSObject *)object { | |
// RCTLog(@"objectProperties %@ %@ Enter", object, object.class); | |
NSMutableArray* properties = [NSMutableArray new]; | |
unsigned int count; | |
Class cls = [object class]; | |
// RCTLog(@"objectProperties %@", cls); | |
do { | |
// RCTLog(@"objectProperties Current %@", cls); | |
objc_property_t* props = class_copyPropertyList(cls, &count); | |
for (int i = 0; i < count; i++) { | |
objc_property_t property = props[i]; | |
NSString *propertyName = [NSString stringWithCString:property_getName(property) encoding:NSUTF8StringEncoding]; | |
[properties addObject:propertyName]; | |
} | |
free(props); | |
cls = [cls superclass]; | |
// RCTLog(@"objectProperties Next %@ ", cls); | |
} while ([cls isSubclassOfClass:[RNNOptions class]] && cls != nil); | |
// RCTLog(@"objectProperties %@ Leave %@", cls, properties); | |
return properties; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment