Skip to content

Instantly share code, notes, and snippets.

@reflog
Created January 26, 2011 14:12
Show Gist options
  • Save reflog/796736 to your computer and use it in GitHub Desktop.
Save reflog/796736 to your computer and use it in GitHub Desktop.
- (BOOL) killerMethod {
return TRUE;
}
- (id) init {
Class z = objc_getClass("Victim");
Method orig = class_getInstanceMethod(z, @selector(victimMethod));
Method repl = class_getInstanceMethod([self class], @selector(killerMethod));
method_exchangeImplementations(orig, repl);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment