Re: Autorelease Question
Re: Autorelease Question
- Subject: Re: Autorelease Question
- From: "Kyle Sluder" <email@hidden>
- Date: Wed, 19 Nov 2008 18:19:45 -0500
Read this document:
http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Concepts/ObjectOwnership.html#//apple_ref/doc/uid/20000043-BEHDEDDB
Then read this one:
http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Tasks/MemoryManagementRules.html
If you are just starting out, don't look for any patterns, just follow
the rules.
If you take ownership of an object, and want to return it and have
nothing more to do with it, you need to relinquish ownership. But if
you just send it -release then it might go away before the caller gets
it back, which is why -autorelease exists.
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden