• 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 methods and (auto)release: conclusion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessor methods and (auto)release: conclusion


  • Subject: Re: Accessor methods and (auto)release: conclusion
  • From: Marcel Weiher <email@hidden>
  • Date: Wed, 7 Aug 2002 00:45:39 +0200

On Wednesday, August 7, 2002, at 12:16 Uhr, Chris Hanson wrote:

You know, all this sounds like a lot of work.

It only sounds like it.

If you use accessor-generation macros, you just say

accessor( var, setVar )

and you're done. It will do the right thing and you don't have to think about it. This makes it very clear (in the code) what is a simple accessor and what is not: anything created by accessor() is a simple accessor. Duh. ;-)

If you want to publish the accessor in your interface, use

accessor_h( var, setVar )

Performance will likely be significantly better than an EOGenericRecord or key/value coding.

Also, if Ondra ever convinces you that accessors need to autorelease, all you have to do is change the macro and recompile, and you can even have the macro generate different code for release-builds (though I wouldn't change the behavior to auto-autorelease).

Marcel

--
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.

References: 
 >Re: Accessor methods and (auto)release: conclusion (From: Chris Hanson <email@hidden>)

  • Prev by Date: Re: Accessor methods and (auto)release: conclusion
  • Next by Date: Re: Accessor methods and (auto)release: conclusion
  • Previous by thread: Re: Accessor methods and (auto)release: conclusion
  • Next by thread: Re: Accessor methods and (auto)release: conclusion
  • Index(es):
    • Date
    • Thread