Re: Create accessor methods quickly with BBEdit
Re: Create accessor methods quickly with BBEdit
- Subject: Re: Create accessor methods quickly with BBEdit
- From: Marcel Weiher <email@hidden>
- Date: Mon, 13 May 2002 23:18:19 +0200
On Monday, May 13, 2002, at 07:10 Uhr, email@hidden wrote:
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.
}
You don't want to do this, as it is quite a bit less efficient.
--
Marcel Weiher Metaobject Software Technologies
email@hidden www.metaobject.com
Metaprogramming for the Graphic Arts. HOM, IDEAs, MetaAd etc.
_______________________________________________
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.