On Wed, Nov 19, 2008 at 5:18 PM, mmalcolm crawford <[EMAIL PROTECTED]> wrote:
>
> On Nov 19, 2008, at 1:57 PM, Jeff Laing wrote:
>>
>> (This is the one thing I hate the *most* about properties - they really
>> feel glued on, at this point, rather than being a language feature that
>> the "whole compiler" knows about)
>>
> It's not clear how this is relevant to the implementation of dealloc?

Because there's essentially no good way to dispose of properties given
the way that they're implemented.

If you set them to nil, then you fall afoul of overridden setters and the like.

If you manually release them, then you explode if you later change the
property from assign to retain or vice versa.

There should be a way to take advantage of the built-in property
mechanism to simply say "do the right thing for this property",
ideally in a single call for an entire class, or even better yet
wholly automatically as part of NSObject's -dealloc implementation or
something. But instead, you get good support for synthesized setters
and getters but once you step into -dealloc you're back on your own,
losing a big part of the advantage, at least if you aren't willing to
hold your nose a bit and simply set them to nil despite the warnings
against it.

Mike
_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to