• 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: Releasing what's in an array?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Releasing what's in an array?


  • Subject: Re: Releasing what's in an array?
  • From: Shawn Erickson <email@hidden>
  • Date: Fri, 25 Feb 2005 10:29:55 -0800


On Feb 25, 2005, at 10:23 AM, Mark Dawson wrote:

If I create a mutable array in my -init function:
    self = [super init];
    if (self) {
        myArray = [[NSMutableArray allocWithZone:[self zone]] init];
    }
    return self;

Do I need to explicitly remove all pieces out the the array before releasing it in my dealloc routine?

No it is not needed. If NSArray/NSMutableArray didn't release what it retained when itself was deallocated it would be breaking the expected memory contract.


-Shawn

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Releasing what's in an array? (From: Mark Dawson <email@hidden>)

  • Prev by Date: Please help a newbie with delegation!
  • Next by Date: Re: Releasing what's in an array?
  • Previous by thread: Releasing what's in an array?
  • Next by thread: Re: Releasing what's in an array?
  • Index(es):
    • Date
    • Thread