Skip to content

Instantly share code, notes, and snippets.

@terinjokes
Created November 18, 2011 19:29
Show Gist options
  • Save terinjokes/1377503 to your computer and use it in GitHub Desktop.
Save terinjokes/1377503 to your computer and use it in GitHub Desktop.
class_getInstanceMethod returns NULL
@implementation RVRenderHandler (PPSlowTransition)
+ (void) initialize
{
Method method = nil;
method = class_getInstanceMethod([self class], @selector(setTransitionTime:));
method->method_name = @selector(_original_setTransitionTime:);
// the above works
method = class_getInstanceMethod([self class], @selector(_ppst_setTransitionTime:)); // returns NULL
method->method_name = @selector(setTransitionTime:);
}
- (void) _ppst_setTransitionTime:(float)time
{
NSLog(@"%f", time);
[self _original_setTransitionTime:time];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment