Created
May 3, 2009 19:39
-
-
Save mfazekas/106127 to your computer and use it in GitHub Desktop.
For tracing objective-c messages: see http://www.unittested.com/2009/5/3/tracing-objective-c-messages
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
@interface LoggerProxy : NSObject | |
{ | |
id original; | |
} | |
- (id)initWithOriginal:(id) value; | |
@end | |
@implementation LoggerProxy | |
- (id) initWithOriginal:(id)value | |
{ | |
if (self = [super init]) { | |
original = value; | |
} | |
return self; | |
} | |
- (NSMethodSignature *)methodSignatureForSelector:(SEL)sel | |
{ | |
NSMethodSignature *sig = [super methodSignatureForSelector:sel]; | |
if(!sig) | |
{ | |
sig = [original methodSignatureForSelector:sel]; | |
} | |
return sig; | |
} | |
- (void)forwardInvocation:(NSInvocation *)inv | |
{ | |
NSLog(@"[%@ %@] %@ %@", original, inv,[inv methodSignature], | |
NSStringFromSelector([inv selector])); | |
[inv invokeWithTarget:original]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment