Re: Memory Management
Re: Memory Management
- Subject: Re: Memory Management
- From: Marcel Weiher <email@hidden>
- Date: Mon, 28 Jul 2003 19:44:26 +0100
On Monday, Jul 28, 2003, at 01:20 Europe/London, Martin Hdcker wrote:
Question: Is there a preferred method? And does one method cause
problems is used?
Yes, their is a preferred method:
This is correct.
--- snip ---
- (NSString *)name
{
return [[_name retain] autorelease];
}
This is not. Although there has been some championing of this method
by well-placed individuals, their preference has not met with an
overwhelmingly positive response, to say the least. IMNSHO, their
case, although appealing at first, has been thoroughly debunked and is
not widely supported by the Cocoa community any longer. Of course, you
may disagree with this view, but at the very least the statement that
this is the preferred method is highly controversial.
- (void)setName:(NSString *)newNamemet {
[newName retain];
[_name release];
_name = newName;
}
This is fine.
Cheers,
Marcel
--
Marcel Weiher Metaobject Software Technologies
email@hidden www.metaobject.com
Metaprogramming for the Graphic Arts. HOM, IDEAs, MetaAd etc.
1d480c25f397c4786386135f8e8938e4
_______________________________________________
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.