• 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: -retain and -release Questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -retain and -release Questions


  • Subject: Re: -retain and -release Questions
  • From: mmalcolm crawford <email@hidden>
  • Date: Sat, 6 Mar 2004 23:40:37 -0800

On Mar 6, 2004, at 11:20 PM, Jerry Krinock wrote:

Generally, if I create (-alloc and -init) an object for temporary use only
within one method, I believe I need to -release this object before the
method returns. This is in contrast to C++, where objects are automatically
deleted when they go out of scope. Is this correct?

(Or -copy) yes.

Am I correct in saying that the only bad effect of omitting a -release or
-autorelease message is that it causes a memory leak?

Yes.

Is there a tool to check my Obj-C/Cocoa app for such memory leaks?

See /Developer/Applications/Performance Tools

See also:
<http://www.alastairs-place.net/cocoa/faq.txt>
references for articles about memory management.

mmalc
_______________________________________________
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: -retain and -release Questions
      • From: Jerry Krinock <email@hidden>
References: 
 >-retain and -release Questions (From: Jerry Krinock <email@hidden>)

  • Prev by Date: -retain and -release Questions
  • Next by Date: Re: NSController, KVC & AppleScript not co-operating
  • Previous by thread: -retain and -release Questions
  • Next by thread: Re: -retain and -release Questions
  • Index(es):
    • Date
    • Thread