Re: Re: nil pointers
Re: Re: nil pointers
- Subject: Re: Re: nil pointers
- From: "Shawn Erickson" <email@hidden>
- Date: Tue, 11 Jul 2006 09:57:57 -0700
On 7/11/06, Rob Ross <email@hidden> wrote:
Isn't it better to find out right away if your method call fails? If
you set theBtn = nil and pass a message to it, it's true that nothing
"bad" will happen, but nothing "good" happens either. It seems this
would be harder to debug than if you just got a stack trace right at
the point of access, so you would know that you were trying to pass a
message to an uninitialized reference.
That assumes that it causes a crash when you send the message. You may
actually end up messaging the wrong object because the unintialized
local var happens to point to a valid (or recently deallocated)
object. In other words you can start to get odd behavior in possibly
unrelated parts of your program... those can be hard to track down.
-Shawn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden