• 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: Accessor method article preview
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Accessor method article preview
      • From: Marcel Weiher <email@hidden>
References: 
 >Re: Accessor method article preview (From: Marcel Weiher <email@hidden>)

  • Prev by Date: Re: What's wrong with "symbol" fonts?
  • Next by Date: Re: Problems printing graphics with transparent backgrounds
  • Previous by thread: Re: Accessor method article preview
  • Next by thread: Re: Accessor method article preview
  • Index(es):
    • Date
    • Thread