Re: Create accessor methods quickly with BBEdit
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.