Created
June 4, 2014 01:07
-
-
Save croath/a9358dac0530d91e9e2b 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
var mc:CUnsignedInt = 0 | |
var mlist:UnsafePointer<Method> = class_copyMethodList(UIImageView.classForCoder(), &mc); | |
println("\(mc) methods") | |
for var i:CUnsignedInt = 0; i < mc; i++ { | |
println("Method #\(i): \(sel_getName(method_getName(mlist.memory)))") | |
mlist = mlist.succ() | |
} |
Fixed for swift 3.
var mc: CUnsignedInt = 0
var mlist: UnsafeMutablePointer<Method?> = class_copyMethodList(FirstViewController.classForCoder(), &mc)
let olist = mlist
print("\(mc) methods")
for i in (0..<mc) {
print("Method #\(i): \(method_getName(mlist.pointee))")
mlist = mlist.successor()
}
free(olist)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Remember to take a copy of the old pointer and free that.