Skip to content

Instantly share code, notes, and snippets.

@jawngee
Created December 9, 2010 01:46
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 jawngee/734215 to your computer and use it in GitHub Desktop.
Save jawngee/734215 to your computer and use it in GitHub Desktop.
-(void)someMethod
{
// I own this!
SomeObject *iOwnThis = [[SomeObject alloc] init];
[iOwnThis doYourThing];
// I release this!
[iOwnThis release];
}
-(void)someOtherMethod:(SomeObject *)someThing
{
// I own this too!
SomeObject *aCopyOfSomeThing = [someThing copy];
[aCopyOfSomeThing doSomething];
// I release this!
[aCopyOfSomeThing release];
}
-(void)yetAnotherMethod
{
// I own this too!
SomeObject *anotherThingIOwn = [SomeObject new];
[anotherThingIOwn doSomething];
// I release this!
[anotherThingIOwn release];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment