Last active
December 11, 2019 17:26
-
-
Save ohnit/dbce2cdeefd432e813c0 to your computer and use it in GitHub Desktop.
LLDB Scripts
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
# print out names of a class's methods by using the class's name. | |
# change the name of the class on the first line. Copy, paste, and press enter | |
po NSString *$className = @"UIView"; | |
po id $myClass = objc_getClass((const char *)[$className cStringUsingEncoding:4]); unsigned int $outCount; Method *$methods = (Method *)class_copyMethodList ($myClass, &$outCount); NSMutableArray *$array = [[NSMutableArray alloc] init]; | |
po for(NSUInteger $i = 0; $i < $outCount; $i++) { Method $method = $methods[$i];NSString *$methodName = [NSString stringWithCString:(char *)sel_getName((SEL)method_getName($method))];[$array addObject:$methodName]; } | |
po $array |
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
# print out properties of a class by using the class's name. | |
# change the name of the class on the first line. Copy, paste, and press enter | |
po NSString *$className = @"UIView"; | |
po id $myClass = objc_getClass((const char *)[$className cStringUsingEncoding:4]); unsigned int $outCount; objc_property_t *$props = (objc_property_t *)class_copyPropertyList($myClass, &$outCount); NSMutableArray *$array = [[NSMutableArray alloc] init]; | |
po for(NSUInteger $i = 0; $i < $outCount; $i++) { objc_property_t $prop = $props[$i];NSString *$propName = [NSString stringWithCString:(char *)property_getName($prop)];[$array addObject:$propName]; } | |
po $array |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment