• 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
question about retain/release
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

question about retain/release


  • Subject: question about retain/release
  • From: Thierry Bucco <email@hidden>
  • Date: Mon, 22 Dec 2003 18:46:07 +0100

Hi evereybody,

I have a little question.

I am reading some documentations about management
(http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/
Concepts/ObjectOwnership.html#//apple_ref/doc/uid/20000043/1000580).

There is a setter function like this one :

- (void) setTitle: (NSString*) newTitle
{
if (newTitle != title)
{
[title release];
title = [newtitle retain];
}
}

In several documentation I have read that I have to release every
object I allocate, copy or retain.
So, why newTitle isn't released on this example ?

Thanks.

thierry
_______________________________________________
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: question about retain/release
      • From: Sven Hoffmann <email@hidden>
    • Re: question about retain/release
      • From: Ed Watkeys <email@hidden>
    • RE: question about retain/release
      • From: "Jonathan E. Jackel" <email@hidden>
    • Re: question about retain/release
      • From: Robert Cerny <email@hidden>
    • Re: question about retain/release
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: Re: NSSearchField menu question
  • Next by Date: Re: Drawing custom text attributes
  • Previous by thread: Re: [OT] True multiuser?
  • Next by thread: Re: question about retain/release
  • Index(es):
    • Date
    • Thread