Re: Checkboxes and NSBox titles
Re: Checkboxes and NSBox titles
- Subject: Re: Checkboxes and NSBox titles
- From: "John C. Randolph" <email@hidden>
- Date: Wed, 13 Jun 2001 06:36:18 -0700
On Tuesday, June 12, 2001, at 07:09 PM, Fritz Anderson wrote:
Begging pardon, but I thought one did
- (void) setMyVal: (id) newVal
{
[myVal autorelease];
myVal = [newVal retain];
}
... yes? Because those methods are no-ops when sent to nil, and
-retain always returns self? No need for conditionals, and no fear of
deallocating myVal if myVal==newVal?
This is a safe way to do it, yes, but I prefer to test and use -release,
since it's somewhat less expensive than inserting myVal into the
autorelease pool.
-jcr
"The right to be heard does not include the right to be taken
seriously." - Hubert Humphrey