• 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: Create accessor methods quickly with BBEdit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Create accessor methods quickly with BBEdit


  • Subject: Re: Create accessor methods quickly with BBEdit
  • From: email@hidden
  • Date: Mon, 13 May 2002 10:10:10 -0700

Matt Gemmell wrote:
|[After running a BBEdit script on example method declarations,] you'll end up with:
|
|- (NSString *)defaultPageName
|{
| return defaultPageName;
|}
|
|- (void)setDefaultPageName:(NSString *)newString
|{
| [newString retain];
| [defaultPageName release];
| defaultPageName = newString;
|}

You can simplify the "set" a bit:

- (void) setDefaultPageName: (NSString *) newString
{
[defaultPageName autorelease]; // Does release "later", after current event is
// completely processed
defaultPageName = [newString retain]; // "retain" returns the retained id.
}

Glen Fisher
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Create accessor methods quickly with BBEdit
      • From: Marcel Weiher <email@hidden>
References: 
 >Create accessor methods quickly with BBEdit (From: Matt Gemmell <email@hidden>)

  • Prev by Date: Re: how to set the NSApp delegate?
  • Next by Date: Re: Sound and frequences ... [OT]
  • Previous by thread: Create accessor methods quickly with BBEdit
  • Next by thread: Re: Create accessor methods quickly with BBEdit
  • Index(es):
    • Date
    • Thread