• 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
Memory Management Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Memory Management Question


  • Subject: Memory Management Question
  • From: Seth Pellegrino <email@hidden>
  • Date: Mon, 2 Jul 2007 11:40:17 -0400

Hello all,

I'm getting a lot of EXC_BAD_ACCESS errors from my code, mostly because I call [object release] and then later on call [object someOtherMethod]. The workaround I've found is that every time I call [object release] I then assign object = nil, and every time I'm working with a possibly dead object, I wrap the code in an if (object) { } block.

That seems like an odd way to manage objects, though. Am I doing something wrong, or is there at least a way to compress the "release and assign nil" block into one line?

Thanks for your help,

Seth
_______________________________________________

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 Question
      • From: "Clark Cox" <email@hidden>
    • Re: Memory Management Question
      • From: "Daniel T. Staal" <email@hidden>
  • Prev by Date: Re: Cocoa and dead-code stripping
  • Next by Date: Re: Memory Management Question
  • Previous by thread: Re: Array controllers, table views and multiple values...
  • Next by thread: Re: Memory Management Question
  • Index(es):
    • Date
    • Thread