• 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: Why should we set ivars to nil in dealloc?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why should we set ivars to nil in dealloc?


  • Subject: Re: Why should we set ivars to nil in dealloc?
  • From: j o a r <email@hidden>
  • Date: Sun, 13 Apr 2008 12:52:20 -0700


On Apr 13, 2008, at 12:36 PM, stephen joseph butler wrote:
Usually it's not. For me, it's 100% a "best practices" thing. It never
hurts, so why not get into the habit of doing it?


Two reasons:

* I don't think that it can be described as a best practice to begin with, and

* You could end up hiding what I would consider to be real problems in your code.

I want to detect real problems as soon as possible. Messaging deallocated objects, or objects that are in the process of being deallocated, is typically an error. The longer time you're unaware of something like this happening in your app, the more expensive it will be to fix it once it becomes a more serious problem.

j o a r


_______________________________________________

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: Why should we set ivars to nil in dealloc?
      • From: "stephen joseph butler" <email@hidden>
References: 
 >NSTextField vertical sizeToFit (From: Jeff <email@hidden>)
 >Why should we set ivars to nil in dealloc? (From: Ferhat Ayaz <email@hidden>)
 >Re: Why should we set ivars to nil in dealloc? (From: "stephen joseph butler" <email@hidden>)

  • Prev by Date: Re: Re: EXC_BAD_ACCESS when calling CGContextDrawLayerInRect
  • Next by Date: Re: NSArray to NSString
  • Previous by thread: Re: Why should we set ivars to nil in dealloc?
  • Next by thread: Re: Why should we set ivars to nil in dealloc?
  • Index(es):
    • Date
    • Thread