Skip to content

Instantly share code, notes, and snippets.

@michaeleisel
Created January 11, 2019 22:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaeleisel/a132c5b894ba8e36986f4526bfda86a8 to your computer and use it in GitHub Desktop.
Save michaeleisel/a132c5b894ba8e36986f4526bfda86a8 to your computer and use it in GitHub Desktop.
-(id)retain
{
NSIncrementExtraRefCount(self);
return self;
}
-(void)release
{
if(NSDecrementExtraRefCountWasZero(self))
{
NSDeallocateObject(self);
}
}
-(id)autorelease
{ // Add the object to the autorelease pool
[NSAutoreleasePool addObject:self];
return self;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment