Skip to content

Instantly share code, notes, and snippets.

@rgregg
Created May 24, 2014 22:29
Show Gist options
  • Save rgregg/5cf07a3f1cbfa8dc6cdf to your computer and use it in GitHub Desktop.
Save rgregg/5cf07a3f1cbfa8dc6cdf to your computer and use it in GitHub Desktop.
Retain/Release Debugging
- (id) retain
{
NSLog(@"%@ retain: count: %d + 1", self, [self retainCount]);
return [super retain];
}
- (void) release
{
NSLog(@"%@ release: count: %d - 1", self, [self retainCount]);
[super release];
}
- (void) dealloc
{
NSLog(@"%@ dealloc: count: %d", self, [self retainCount]);
[super dealloc];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment