Skip navigation.
 
mlRe: Why should we set ivars to nil in dealloc?
FROM : j o a r
DATE : Sun Apr 13 21:52:20 2008

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

Related mailsAuthorDate
mlWhy should we set ivars to nil in dealloc? Ferhat Ayaz Apr 13, 19:48
mlRe: Why should we set ivars to nil in dealloc? Jonathan del Strot… Apr 13, 20:00
mlRe: Why should we set ivars to nil in dealloc? j o a r Apr 13, 21:14
mlRe: Why should we set ivars to nil in dealloc? Jerry Krinock Apr 13, 21:27
mlRe: Why should we set ivars to nil in dealloc? stephen joseph but… Apr 13, 21:36
mlRe: Why should we set ivars to nil in dealloc? Adam R. Maxwell Apr 13, 21:41
mlRe: Why should we set ivars to nil in dealloc? j o a r Apr 13, 21:41
mlRe: Why should we set ivars to nil in dealloc? j o a r Apr 13, 21:52
mlRe: Why should we set ivars to nil in dealloc? stephen joseph but… Apr 13, 21:56
mlRe: Why should we set ivars to nil in dealloc? Ferhat Ayaz Apr 13, 22:08
mlRe: Why should we set ivars to nil in dealloc? j o a r Apr 13, 23:53
mlRe: Why should we set ivars to nil in dealloc? Clark Cox Apr 13, 23:57
mlRe: Why should we set ivars to nil in dealloc? Ben Trumbull Apr 14, 01:35
mlRe: Why should we set ivars to nil in dealloc? Bill Bumgarner Apr 14, 05:39
mlRe: Why should we set ivars to nil in dealloc? Tony Becker Apr 14, 14:29
mlRe: Why should we set ivars to nil in dealloc? j o a r Apr 14, 17:05
mlRe: Why should we set ivars to nil in dealloc? Scott Ribe Apr 16, 17:56