• 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
I think I get most of the memory stuff but...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

I think I get most of the memory stuff but...


  • Subject: I think I get most of the memory stuff but...
  • From: Theodore Petrosky <email@hidden>
  • Date: Sun, 4 May 2003 18:41:18 -0700 (PDT)

These conversations on memory management are useful
but one issue has never been discussed. why do I have
to retain a passed in value.

in a common setter....

-(void)setClientCode:(NSString *) aString {
[aString retain];
[clientCode release];
clientCode=aString;
}

I assume that aString is a convenience construct that
is autoreleased. Why do I have to retain it? Why
doesn't it live through the method? I finally
understand the autorelease mechanics. I just do get
why I need to retain aString.

Ted

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
_______________________________________________
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: I think I get most of the memory stuff but...
      • From: "Tony S. Wu" <email@hidden>
    • Re: I think I get most of the memory stuff but...
      • From: Sherm Pendley <email@hidden>
  • Prev by Date: Re: MIME types?
  • Next by Date: Re: monitoring table selection
  • Previous by thread: NSUserKeyEquivalent not working?
  • Next by thread: Re: I think I get most of the memory stuff but...
  • Index(es):
    • Date
    • Thread