FROM : Scott Ribe
DATE : Tue Mar 25 22:06:00 2008
> Aside from that. Are there tutorials or some such for these Cocoa
> Release ideals or will I cross them when I read the pdf ?
There's a *very* simple set of rules to follow regarding retain/release.
Newbies sometimes make it hard on themselves by doing extra work, rather
than trying to follow the rules. Of course ultimately you want to understand
the rules, but they're simple enough that you can write correct code before
you even get to that point. If you just follow the rules, rather than
assuming that there's some mysterious complexity omitted and trying to
squeeze in a few extra retains/releases here and there in order to
compensate for the documentation's non-existent deficiencies ;-) That's a
little exaggerated. What we see most typically with newbies is neglecting by
accident to follow the rules at some point, then trying to peek at retain
counts to debug it, then getting themselves confused and adding
spurious/incorrect memory management code.
--
Scott Ribe
<email_removed>
http://www.killerbytes.com/
(303) 722-0567 voice
DATE : Tue Mar 25 22:06:00 2008
> Aside from that. Are there tutorials or some such for these Cocoa
> Release ideals or will I cross them when I read the pdf ?
There's a *very* simple set of rules to follow regarding retain/release.
Newbies sometimes make it hard on themselves by doing extra work, rather
than trying to follow the rules. Of course ultimately you want to understand
the rules, but they're simple enough that you can write correct code before
you even get to that point. If you just follow the rules, rather than
assuming that there's some mysterious complexity omitted and trying to
squeeze in a few extra retains/releases here and there in order to
compensate for the documentation's non-existent deficiencies ;-) That's a
little exaggerated. What we see most typically with newbies is neglecting by
accident to follow the rules at some point, then trying to peek at retain
counts to debug it, then getting themselves confused and adding
spurious/incorrect memory management code.
--
Scott Ribe
<email_removed>
http://www.killerbytes.com/
(303) 722-0567 voice






Cocoa mail archive

