Re: Accessor method article preview
Re: Accessor method article preview
- Subject: Re: Accessor method article preview
- From: Marcel Weiher <email@hidden>
- Date: Thu, 27 Jun 2002 11:03:42 +0200
(Just catching up on my e-mail)
How about going a bit further and letting the Macro generate the entire
method? In fact, why not let it generate both the getter and setter?
idAccessor( name, setName )
produces both the (trivial) get-accessor and the (not so trivial)
set-accessor. See MPWFoundation.
On Thursday, June 13, 2002, at 05:41 Uhr, Edwin Zacharias wrote:
Thanks very much for the accolades, mmalc. Here's one quick tip that
is probably beyond the scope of your article as it will just make
things more complicated for new programmers.
All my setters look like this:
- (void)setName: (NSString *)name
{
SCSetObject( __name, name );
}
Nice and simple. Here's the define:
#define SCSetObject(oldObject, newObject) [ newObject retain ],
[ oldObject release], oldObject = newObject;
I'm now able to make changes to all my setters system wide based on the
stuff I learned in your article. I should have also created an
SCGetObject define to use for getter methods, but I didn't think that
far ahead.
--
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.