• 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
NSMutableArray, NSMutableDictionary memory managment
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSMutableArray, NSMutableDictionary memory managment


  • Subject: NSMutableArray, NSMutableDictionary memory managment
  • From: Scott Price <email@hidden>
  • Date: Thu, 11 Sep 2008 10:11:33 -0700

I'm wondering how NSMutableArray and NSMutableDictionary handle objects if you add and object to them. I'm working on an iphone where memory management is important and kinda iffy how these objects work.

Say if you allocate a temp object and add it to an NSMutableArray and then release it afterwords, does the NSMutableArray not make a deep copy and will lose the the variable?

example
NSMutableArray* arr = [[NSMutableArray]init];
NSString* bam = [[NSString alloc]initWithString:@"Shazam"];
[arr addObject:bam];
[release bam];

if i were to do this would arr lose the contents of bam?

_______________________________________________

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: NSMutableArray, NSMutableDictionary memory managment
      • From: Jamie Hardt <email@hidden>
  • Prev by Date: Re: creating new instance of coredata entity
  • Next by Date: Re: NSMutableArray, NSMutableDictionary memory managment
  • Previous by thread: Re: creating new instance of coredata entity
  • Next by thread: Re: NSMutableArray, NSMutableDictionary memory managment
  • Index(es):
    • Date
    • Thread