Created
December 9, 2010 01:46
-
-
Save jawngee/734215 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
-(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