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
@implementation NSObject (forSwift) | |
- (id)__performSelector:(SEL)aSelector | |
{ | |
Method m = class_getInstanceMethod(self.class, aSelector); | |
const char *types = method_copyReturnType(m); | |
if (strcmp("v", types)) { | |
return [self performSelector:aSelector]; | |
} else { |
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() | |
} | |
} |