On Tue, Aug 5, 2008 at 1:12 AM, Uli Kusterer
<[EMAIL PROTECTED]> wrote:
> On 05.08.2008, at 05:55, Jonathan Hess wrote:
>>
>> The implementation of the property will manage the retaining and the
>> releasing. You only need to worry about sending retain and release messages
>> manually if you access the instance variable directly (not through a
>> property). The only place you would typically need to do that would be in
>> your dealloc method.
>
>
>  Although in dealloc
>
>        self.myProperty = nil;
>
> would also work, which has the added benefit that you'll notice when you're
> talking to an object that has already been released, because then all its
> object ivars will be NIL.

A disadvantage of this approach is that you'll be invoking the setter
when your object is partially torn down.  If you later override or
implement the method, you are not likely to be thinking about the
possibility that the object is not in a valid state.  Calling methods
from init has the same issue.

You may fire off observer methods too, which is probably undesirable.

-Ken
_______________________________________________

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