Re: resetting ivars safely
Re: resetting ivars safely
- Subject: Re: resetting ivars safely
- From: "Shawn Erickson" <email@hidden>
- Date: Wed, 12 Sep 2007 18:28:32 -0700
On 9/12/07, Daniel Child <email@hidden> wrote:
> The first time, retain count is 1, and the objects are all there (4
> objects in the array).
> Later on, the retain count is 0, and there are no objects.
>
> But doesn't that mean there is a problem with the setters paradigm of
> "release then copy"?
In the code you posted I don't see anything that would explain the
issue you report at least not the way you have reported.
Note you should switch to use [NSMutableArray array] instead of
[[NSMutableArray alloc] init] in your classes init method (the
setSyllables: and setWordCandidates:) lines. Review the memory
documentation to understand why (hint you are leaking those initial
instances)
-Shawn
_______________________________________________
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