• 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: Autorelease question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Autorelease question


  • Subject: Re: Autorelease question
  • From: Dmitry Markman <email@hidden>
  • Date: Thu, 3 Apr 2008 22:32:04 -0400

thanks
as Adam Leonard said (email@hidden) (BTW in reply to my note)


Also, a small note:


Aaron Hillehass in his book, said that if object wasn't created with
alloc, new, copy or mutableCopy then that object will be added
to the default autorelease pool

Reread that sentence in Hillegass's book.It says to "assume...[the object] is in the autorelease pool". It will not always be the case that an object not created with alloc, copy, etc. will be in an autorelease pool. It might be a singleton or cached in some way. These are usually implementation details, but just watch out.

and I agree with him.
so as you can see I'm very well aware about "alloc, new, copy or mutableCopy"
and my initial question was


How can I tell is there autorelease pool in my application?
because if it does exist I don't have to create my own

and as Jens answered, there is no way to say


On Apr 3, 2008, at 10:24 PM, stephen joseph butler wrote:

On Thu, Apr 3, 2008 at 9:18 PM, Dmitry Markman <email@hidden> wrote:

I just thought that all those 5 methods are CREATION methods they are not
GET methods
so how do I know which one I should release?


You're way over analyzing this. Does the *method name* contain the words
alloc, new, copy or mutableCopy? If yes, then call release. Otherwise, it
will be put in the autorelease pool.


You're going into the *documentation* and looking for those words. The
paradigm is based on method names, however, so that you don't have to go to
the documentation while you're coding.
_______________________________________________


Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

Dmitry Markman

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Autorelease question (From: Dmitry Markman <email@hidden>)
 >Re: Autorelease question (From: Robert Claeson <email@hidden>)
 >Re: Autorelease question (From: Jens Alfke <email@hidden>)
 >Re: Autorelease question (From: Dmitry Markman <email@hidden>)
 >Re: Autorelease question (From: Chris Suter <email@hidden>)
 >Re: Autorelease question (From: Dmitry Markman <email@hidden>)
 >Re: Autorelease question (From: "stephen joseph butler" <email@hidden>)

  • Prev by Date: Re: Autorelease question
  • Next by Date: Re: Autorelease question
  • Previous by thread: Re: Autorelease question
  • Next by thread: Re: Autorelease question
  • Index(es):
    • Date
    • Thread