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

Re: question about retain/release


  • Subject: Re: question about retain/release
  • From: Robert Cerny <email@hidden>
  • Date: Mon, 22 Dec 2003 20:14:44 +0100

Hi,
you're responsible for releasing of objects you actually create. You
didn't create newTitle in the displayed method, so you don't release
it.

HTH
Robert

On 22.12.2003, at 18:46, Thierry Bucco wrote:

> 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.

[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.

References: 
 >question about retain/release (From: Thierry Bucco <email@hidden>)

  • Prev by Date: Re: question about retain/release
  • Next by Date: RE: question about retain/release
  • Previous by thread: Re: question about retain/release
  • Next by thread: RE: question about retain/release
  • Index(es):
    • Date
    • Thread