• 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
How to properly dealloc NSDictionary instance
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to properly dealloc NSDictionary instance


  • Subject: How to properly dealloc NSDictionary instance
  • From: Mark Wade <email@hidden>
  • Date: Sat, 21 Jul 2007 11:18:19 -0400

Hello list,

Since I allocated both the keys and values in an NSMutableDictionary I thought I would be responsible for deallocating them so I use a keysEnumerator and a objectEnumerator to loop though them and release them. That seems to work okay but when I add ["NSDictionary instance" release] (not literal code) the app drops into the debugger on exit. If I exclude iterating through the keys and values and just release the dictionary that works okay.

Do I just need to release the dictionary and its keys and objects will be released also? Or if I iterate through the keys and objects and release them is the dictionary also released.

--mark, somewhat unsure of object disposal, wade

_______________________________________________

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: How to properly dealloc NSDictionary instance
      • From: Mark Wade <email@hidden>
    • Re: How to properly dealloc NSDictionary instance
      • From: mmalc crawford <email@hidden>
    • Re: How to properly dealloc NSDictionary instance
      • From: Mike Abdullah <email@hidden>
  • Prev by Date: Best way to draw NSBezierPath to CIImage
  • Next by Date: Re: How to properly dealloc NSDictionary instance
  • Previous by thread: Re: problem +colorWithPatternImage ( NOT -setPatternPhase )
  • Next by thread: Re: How to properly dealloc NSDictionary instance
  • Index(es):
    • Date
    • Thread