• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: resetting ivars safely
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: resetting ivars safely
      • From: Daniel Child <email@hidden>
References: 
 >resetting ivars safely (From: Daniel Child <email@hidden>)
 >Re: resetting ivars safely (From: "Shawn Erickson" <email@hidden>)
 >Re: resetting ivars safely (From: Daniel Child <email@hidden>)

  • Prev by Date: Re: resetting ivars safely
  • Next by Date: Re: resetting ivars safely
  • Previous by thread: Re: resetting ivars safely
  • Next by thread: Re: resetting ivars safely
  • Index(es):
    • Date
    • Thread