• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Memory Management
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Memory Management
      • From: Bill Cheeseman <email@hidden>
    • Re: Memory Management
      • From: Fritz Anderson <email@hidden>
References: 
 >Re: Memory Management (From: Martin Häcker <email@hidden>)

  • Prev by Date: Re: Document based app confusion
  • Next by Date: problem with NSScrollView
  • Previous by thread: Re: Memory Management
  • Next by thread: Re: Memory Management
  • Index(es):
    • Date
    • Thread