Because you have no idea what subclassers may do in their overrides of the accessors (e.g. The subclassed accessor may rely on state that's been torn down earlier in -dealloc).

It's just not safe, unless you can guarantee that you own the entire inheritance chain.

.chris


On Jul 8, 2009, at 6:08 PM, Erik Buck <erik.b...@sbcglobal.net> wrote:

What about properties that aren't backed by instance variables? Accessors are still needed to set properties stored in an auxiliary dictionary etc. There are literally only hours left for me to change a recommendation in "Cocoa Design Patterns" that you SHOULD use accessors in initializers and -dealloc. Remind me again why I shouldn't ?

--- On Wed, 7/8/09, Bill Bumgarner <b...@mac.com> wrote:

From: Bill Bumgarner <b...@mac.com>
Subject: Re: Clarification on accessors? (was: Yet another memory management question)
To: "Sean McBride" <s...@rogue-research.com>
Cc: "Erik Buck" <erik.b...@sbcglobal.net>, cocoa-dev@lists.apple.com
Date: Wednesday, July 8, 2009, 7:23 PM

On Jul 8, 2009, at 1:40 PM, Sean McBride wrote:
On 7/8/09 11:20 AM, Erik Buck said:
The bottom line is that accessors are the only way to set synthesized
instance variables to nil in the modern (64bit) Objective-C runtime.
True. But if I remember previous discussions correctly, that's a bug,
not a feature.

Correct. 'Tis a bug. A fixed one, too, if you have access to the Snow Leopard seeds or grab the clang compiler from the llvm.org repository.

b.bum

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/ctp%40apple.com

This email sent to c...@apple.com
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to