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

Re: nil pointers


  • Subject: Re: nil pointers
  • From: Bill Bumgarner <email@hidden>
  • Date: Tue, 11 Jul 2006 10:06:06 -0700

On Jul 11, 2006, at 10:00 AM, Andreas Mayer wrote:
Am 11.07.2006 um 18:40 Uhr schrieb Rob Ross:

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.

Right. But you might *not* get a stack trace either. Instead, the uninitialized variable might point to some other object, that might either choke (which will make you wonder who the hell did send that message to that object) or do something totally non-obvious which will be a PITA to debug.


I'd rather have something *not* work at all, than having it do something random.

Now, if we had a this-is-uninitialized-please-complain type of value, I'd use that ...

Hm. I guess one could use a singleton like [NSNull null]. [NSInvalid invalid]? I may actually give that a try.

NSArray *arrayIAmGoingToGetFromSomewhereMaybe = (id) 0x1; _______________________________________________ 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
  • Follow-Ups:
    • Re: nil pointers
      • From: Uli Kusterer <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>)
 >Re: nil pointers (From: Andreas Mayer <email@hidden>)

  • Prev by Date: Re: copy vs mutableCopy?
  • Next by Date: Cocoa bindings with NSUserDefaultsController
  • Previous by thread: Re: nil pointers
  • Next by thread: Re: nil pointers
  • Index(es):
    • Date
    • Thread