Re: Making views disappear and reappear
Re: Making views disappear and reappear
- Subject: Re: Making views disappear and reappear
- From: Clyde McQueen <email@hidden>
- Date: Mon, 25 Jun 2001 09:26:24 -0700
On Saturday, June 23, 2001, at 09:48 PM, Mark T wrote:
But why was there no error reported at runtime for getting the
superview of a view that's not in a view?
It's a general Obj-C behavior: a message to nil returns nil. (Sort of
like 0 * x => 0.)
Here are my two "Magic Debugging Rules:"
1. Crash (SIG*) almost* always means you're holding a pointer to a
released object.
2. "Missing" behavior almost always means that you're passing a message
to nil.
/Clyde
*But don't forget pass nil to calls like:
[NSArray arrayWithObjects:x, y, z, nil]
That'll also crash.