Skip navigation.
 
mlRe: Garbage collection - was Beginner with Cocoa
FROM : Rob Napier
DATE : Wed Mar 26 00:02:12 2008

On Tue, Mar 25, 2008 at 6:15 PM, Randall Meadows <<email_removed>>
wrote:

> On Mar 25, 2008, at 4:07 PM, Nick Zitzmann wrote:
> >
> > On Mar 25, 2008, at 4:01 PM, Jack Repenning wrote:
> >> On Mar 25, 2008, at 2:06 PM, Scott Ribe wrote:
> >>> There's a *very* simple set of rules to follow regarding retain/
> >>> release.
> >>
> >> Yes, but where are they documented?
> >
> >
> >
> <file:///Developer/Documentation/DocSets/com.apple.ADC_Reference_Library.CoreReference.docset/Contents/Resources/Documents/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaObjects/chapter_3_section_5.html
> > >
>
> I was thinking <
> http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Concepts/ObjectOwnership.html#//apple_ref/doc/uid/20000043
>  >.



If people will read nothing but "Practical Memory Management" (the page
after the one you linked here, and all of 1500 words long), they will be
fine for nearly everything. By the time they need more than that one page,
they will probably know what they don't know and be able to figure it out.

When I got started, Cocoa memory management scared me too, and yet I seldom
run into memory problems (except in Objective-C++) much as I thought they
would plague me. If 1500 words are too much to read, read these two
sentences from "Practical Memory Management" (which echo everything that has
been said here) and 90% of your problems will go away:

"Sometimes it might seem tedious or pedantic, but if you use accessor
methods consistently the chances of having problems with memory management
decrease considerably. If you are using retain and release on a class's
instance variables throughout your code, you are almost certainly doing the
wrong thing."

And XCode will write those accessors for you.

-Rob

--
Rob Napier -- Software and Security Consulting -- http://robnapier.net

Related mailsAuthorDate
mlBeginner with Cocoa Alex Handley Mar 21, 20:00
mlRe: Beginner with Cocoa Jeff LaMarche Mar 21, 20:21
mlRe: Beginner with Cocoa Jack Repenning Mar 24, 05:16
mlRe: Beginner with Cocoa Sherm Pendley Mar 24, 05:44
mlRe: Beginner with Cocoa Jeff LaMarche Mar 24, 13:12
mlRe: Beginner with Cocoa Erik Buck Mar 24, 15:13
mlRe: Beginner with Cocoa Scott Thompson Mar 24, 15:32
mlGarbage collection - was Beginner with Cocoa Bill Cheeseman Mar 24, 15:57
mlRe: Garbage collection - was Beginner with Cocoa colo Mar 24, 16:30
mlRe: Garbage collection - was Beginner with Cocoa Bill Cheeseman Mar 24, 17:12
mlRe: Garbage collection - was Beginner with Cocoa Erik Buck Mar 24, 17:12
mlRe: Garbage collection - was Beginner with Cocoa Clark Cox Mar 24, 17:45
mlRe: Beginner with Cocoa Jack Repenning Mar 24, 18:01
mlRe: Garbage collection - was Beginner with Cocoa colo Mar 24, 18:02
mlRe: Garbage collection - was Beginner with Cocoa Scott Thompson Mar 24, 18:36
mlRe: Beginner with Cocoa colo Mar 24, 18:43
mlRe: Garbage collection - was Beginner with Cocoa Bill Cheeseman Mar 24, 18:45
mlRe: Beginner with Cocoa Jeff LaMarche Mar 24, 18:54
mlRe: Beginner with Cocoa Sherm Pendley Mar 24, 18:57
mlRe: Beginner with Cocoa Chris Hanson Mar 24, 19:39
mlRe: Beginner with Cocoa Clark Cox Mar 24, 19:44
mlRe: Garbage collection - was Beginner with Cocoa colo Mar 24, 21:03
mlRe: Garbage collection - was Beginner with Cocoa has Mar 24, 22:59
mlRe: Garbage collection - was Beginner with Cocoa Scott Thompson Mar 25, 03:15
mlRe: Beginner with Cocoa Scott Ribe Mar 25, 21:57
mlRe: Garbage collection - was Beginner with Cocoa Scott Ribe Mar 25, 22:06
mlRe: Beginner with Cocoa Bill Cheeseman Mar 25, 22:40
mlRe: Garbage collection - was Beginner with Cocoa Jack Repenning Mar 25, 23:01
mlRe: Garbage collection - was Beginner with Cocoa Nick Zitzmann Mar 25, 23:07
mlRe: Garbage collection - was Beginner with Cocoa Paul Bruneau Mar 25, 23:11
mlRe: Garbage collection - was Beginner with Cocoa Randall Meadows Mar 25, 23:15
mlRe: Garbage collection - was Beginner with Cocoa Rob Napier Mar 26, 00:02
mlRe: Garbage collection - was Beginner with Cocoa Jack Repenning Mar 26, 00:28
mlRe: Garbage collection - was Beginner with Cocoa colo Mar 26, 00:52
mlRe: Garbage collection - was Beginner with Cocoa Erik Buck Mar 26, 01:38
mlRe: Garbage collection - was Beginner with Cocoa mmalc crawford Mar 26, 06:24