Re: Accessor method article preview
Re: Accessor method article preview
- Subject: Re: Accessor method article preview
- From: Edwin Zacharias <email@hidden>
- Date: Thu, 27 Jun 2002 10:05:43 -0400
It's definitely a good idea, but how often do you want an untyped setter
that just sets the ivar and does nothing else? Here's a setter from my
code:
- (void)setImage: (NSImage *)image
{
SCSETOBJECT( scImage, image );
[ scImageView setImage: image ];
[ self sizingOptionsDidChange ];
}
That's where my macro comes in handy. As far as I know there's no good
way to make it simpler.
- Edwin
On Thursday, June 27, 2002, at 05:03 AM, Marcel Weiher wrote:
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.
_______________________________________________
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.