• 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: Checkboxes and NSBox titles
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Checkboxes and NSBox titles


  • Subject: Re: Checkboxes and NSBox titles
  • From: Fritz Anderson <email@hidden>
  • Date: Tue, 12 Jun 2001 21:09:37 -0500

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?

-- F


At 4:41 PM -0700 6/12/2001, John C. Randolph wrote:
D'oh! you're right. that should be:

- (void) setTitleCell:(NSCell *) aCell
{
if (aCell && (_titleCell != aCell))
{
[_titleCell release];
[_aCell retain];
_titleCell = aCell;
}
}


  • Follow-Ups:
    • Re: Checkboxes and NSBox titles
      • From: "John C. Randolph" <email@hidden>
    • Re: Checkboxes and NSBox titles
      • From: John Hörnkvist <email@hidden>
References: 
 >Re: Checkboxes and NSBox titles (From: "John C. Randolph" <email@hidden>)

  • Prev by Date: Re: Getting select click
  • Next by Date: Re: Getting select click
  • Previous by thread: Re: Checkboxes and NSBox titles
  • Next by thread: Re: Checkboxes and NSBox titles
  • Index(es):
    • Date
    • Thread