Created
June 10, 2014 11:27
-
-
Save tarunon/89f0f1904ac7c6e6a0c7 to your computer and use it in GitHub Desktop.
Print Classes and Methods
This file contains 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
func printClasses() { | |
var count: CUnsignedInt = 0 | |
var clist = objc_copyClassList(&count) | |
for var i: CUnsignedInt = 0; i < count; i++ { | |
let c : AnyClass? = clist.memory | |
println(" #Class \(class_getName(c))") | |
printMethods(c) | |
clist = clist.succ() | |
} | |
} | |
func printMethods(c: AnyClass?) { | |
var count: CUnsignedInt = 0 | |
var mlist = class_copyMethodList(c, &count) | |
for var i: CUnsignedInt = 0; i < count; i++ { | |
let m : Method? = mlist.memory | |
println(" #Method \(method_getName(m!))") | |
mlist = mlist.succ() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment