Re: How far with accessors?
Re: How far with accessors?
- Subject: Re: How far with accessors?
- From: Ondra Cada <email@hidden>
- Date: Thu, 27 May 2004 02:06:21 +0200
Jeff,
On 26.5.2004, at 23:58, Jeff Biggus wrote:
>
> -(void)dealloc {
>
> [self setTheString:nil];
>
> ...
>
> }
>
>
Perhaps I need to read the whole thread, but I've never seen it
>
suggested that one should simply nil out an object. In general, the
>
preferred way is simply to do a release:
You seem to miss that my code does not "simply nil", but nil through
the setter. Since the setter *must* be written so that it releases the
previous value before setting the new one, bingo!
The advantage is that this automatically uses autorelease or release
depending on the accessor pattern you use, it does not break if you
change the internal representation, yadda yadda...
---
Ondra Hada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.