• 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: Re: nil pointers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >nil pointers (From: "Adam Johnson" <email@hidden>)
 >Re: nil pointers (From: Uli Kusterer <email@hidden>)
 >Re: nil pointers (From: Rob Ross <email@hidden>)

  • Prev by Date: Re: file ICONS
  • Next by Date: Re: nil pointers
  • Previous by thread: Re: nil pointers
  • Next by thread: Re: nil pointers
  • Index(es):
    • Date
    • Thread