• 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: Clarification on accessors? (was: Yet another memory management question)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Clarification on accessors? (was: Yet another memory management question)


  • Subject: Re: Clarification on accessors? (was: Yet another memory management question)
  • From: Jim Correia <email@hidden>
  • Date: Sat, 11 Jul 2009 10:09:50 -0400

On Jul 9, 2009, at 5:52 PM, Charles Srstka wrote:

On Jul 9, 2009, at 4:29 PM, Ben Trumbull wrote:

It may be that under certain circumstances (dictionary storage, synthesized properties on 10.5, etc) that you must use an accessor method even in init & dealloc. That requires more care, is more error prone, and less flexible. In particular, additional behavior should not be adorned to the accessor, and the accessor must never leak knowledge of the receiver to a third party during init or dealloc. Basically, these accessors must be very very boring.

But if it's a synthesized accessor, wouldn't it be pretty much a given that that would be the case?

That will be the case for your class, with its synthesized accessors. If a subclass overrides those accessors, though, you'll be invoking them during setup and teardown too.


The overridden accessors, by definition, add side effects or behavior.

- Jim




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Clarification on accessors? (was: Yet another memory management question) (From: Ben Trumbull <email@hidden>)
 >Re: Clarification on accessors? (was: Yet another memory management question) (From: Charles Srstka <email@hidden>)

  • Prev by Date: Re: UITextView and UiImageView
  • Next by Date: Re: Cocoa Frontend to SDL App
  • Previous by thread: Re: Clarification on accessors? (was: Yet another memory management question)
  • Next by thread: Cocoa developers in Victoria BC
  • Index(es):
    • Date
    • Thread