Skip to content

Instantly share code, notes, and snippets.

@aufflick
Created January 14, 2010 01:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save aufflick/276769 to your computer and use it in GitHub Desktop.
Save aufflick/276769 to your computer and use it in GitHub Desktop.
#import <objc/objc-class.h>
@implementation NSObject (override)
- (void) releaseLog
{
fprintf(stderr, "release: %s\n", class_getName([self class]));
// now call the original implementation (swapped with releaseLog)
// to actually effect the release
[self releaseLog];
}
- (id) autoreleaseLog
{
fprintf(stderr, "autorelease: %s\n", class_getName([self class]));
// now call the original implementation (swapped with autoreleaseLog)
return [self autoreleaseLog];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment