• 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: Memory management with arrays
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Memory management with arrays


  • Subject: Re: Memory management with arrays
  • From: ss2 cire <email@hidden>
  • Date: Sat, 9 Feb 2008 22:57:39 -0800

yay, one i THINK i can answer =)

I thought NSArray already automatically retained all objects that were added to it?
then once the array is released (dealloced?) the objects within are released as well
so you may only need to just send it an auto released object


so...

void foo()
{
	[array removeAllObjects];
	Bar *bar = [[Bar alloc] init];

	[array addObject:bar];
}


that should work fine, shouldn't it?

please correct me if I'm wrong.

regards

Eric
_______________________________________________

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: Memory management with arrays
      • From: Bill Bumgarner <email@hidden>
References: 
 >Memory management with arrays (From: Jacob Bandes-Storch <email@hidden>)
 >Re: Memory management with arrays (From: Scott Andrew <email@hidden>)
 >Re: Memory management with arrays (From: Bill Bumgarner <email@hidden>)

  • Prev by Date: Re: Memory management with arrays
  • Next by Date: Re: Garbage Collection in commandline applications
  • Previous by thread: Re: Memory management with arrays
  • Next by thread: Re: Memory management with arrays
  • Index(es):
    • Date
    • Thread