Created
April 4, 2015 16:30
-
-
Save Koze/5a9e38f55c2780cce17a to your computer and use it in GitHub Desktop.
Print Class Hierarchy
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
| #import <objc/runtime.h> | |
| void PrintClassHierarchy(Class cls) { | |
| printf("// Class Hierarchy of %s\n", class_getName(cls)); | |
| Class superClass = cls; | |
| while (superClass) { | |
| printf("%s", class_getName(superClass)); | |
| superClass = class_getSuperclass(superClass); | |
| if (superClass) { | |
| printf(" : "); | |
| } | |
| } | |
| printf("\n"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment