Re: nil pointers
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