• 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: NSMutableDictionary autorelease chrashes application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMutableDictionary autorelease chrashes application


  • Subject: Re: NSMutableDictionary autorelease chrashes application
  • From: Matthias Arndt <email@hidden>
  • Date: Fri, 18 Jul 2008 16:34:53 +0200

Robert,

Am 18.07.2008 um 16:25 schrieb Robert Martin:

In the next line, you reassign vAttributes to the contents of your iVar dictionary. Nothing points to that alloc'd dictionary in the first line anymore.

Since vAttributes now points to an autoreleased dictionary, attempting to release it will cause a crash.

THAT makes sense, I just didn't realize that "objectForKey" returns an autorelease object! I just removed the first allocation of "vAttributes" what fixes the problem.


Promised, I'll try to master the debugger as well. Currently I'm able to trace the code and track my variables, but allocation / release pools are still a challange ...

Thanks, guys!

Mattes

_______________________________________________

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: NSMutableDictionary autorelease chrashes application
      • From: "Shawn Erickson" <email@hidden>
References: 
 >NSMutableDictionary autorelease chrashes application (From: Matthias Arndt <email@hidden>)
 >Re: NSMutableDictionary autorelease chrashes application (From: Robert Martin <email@hidden>)

  • Prev by Date: Re: Controlling Preferences on iPhone
  • Next by Date: Problem compiling first Cocoa app
  • Previous by thread: Re: NSMutableDictionary autorelease chrashes application
  • Next by thread: Re: NSMutableDictionary autorelease chrashes application
  • Index(es):
    • Date
    • Thread