Re: Properties and memory management
Re: Properties and memory management
- Subject: Re: Properties and memory management
- From: Negm-Awad Amin <email@hidden>
- Date: Tue, 5 Aug 2008 10:21:05 +0200
Am Di,05.08.2008 um 10:12 schrieb Uli Kusterer:
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.
Hallo Uli, alles klar?
yup, that's the better way. It has the additional advantage, that you
have no unbalanced -release in your source code. But sometimes you
have to take care about undo registration. (registration of an
attribute change of a dead object.)
Amin
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.
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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
Amin Negm-Awad
email@hidden
_______________________________________________
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