• 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:50:08 -0400

well here is some summary
1. I read all that documentation, please, enough about that, really
2. I should follow the "alloc, new, copy or mutableCopy" rule. I should note
that I'm talking about creation methods not create/copy/get methods all of that
notes about looking to the name (what in your name :-)) )
3. but I agree with Adam comment that the rule isn't 100% reliable and therefore isn't good enough
4. following Jens advice
create pool by myself
and don't release object if they were created by non "alloc, new, copy or mutableCopy " (again not good enough)
and release the pool


thank you very much to all who answered



On Apr 3, 2008, at 10:32 PM, Chris Suter wrote:


On 04/04/2008, at 1:25 PM, Dmitry Markman wrote:

how can you explain that
NSString *nsFontName = [NSString stringWithCString:fontName encoding:NSMacOSRomanStringEncoding];
can be released, but
NSString *textString = [NSString stringWithCString:"Hello From Cocoa" encoding:NSMacOSRomanStringEncoding];
can not
so what's the difference?

Neither of them should be released; there's no difference.

or yes there is a difference with one application crashes with another it doesn't
or you can see the difference between life and death :-))





Nobody wants to answer memory management questions on this list, not least because it's better said in the documentation. It's very comprehensively covered in the documentation so please take the time to read and understand them.

well, as I said few times documentation you mentioned simply isn't good enough. that's all
good documentation should say in every discussion paragraph: that object is autoreleased, or isn't autoreleased
that's all
even for get/create/copy methods, because there are always exceptions (or will be)


computer language documentation shouldn't be like English (or any other language) grammar, where for every rule there are
more then one exceptions and that's, the rule :-) (probably single rule without exception)





- Chris


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


  • Follow-Ups:
    • Re: Autorelease question
      • From: Jens Alfke <email@hidden>
    • Re: Autorelease question
      • From: Adam Leonard <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: Dmitry Markman <email@hidden>)
 >Re: Autorelease question (From: Rob Keniger <email@hidden>)
 >Re: Autorelease question (From: Dmitry Markman <email@hidden>)
 >Re: Autorelease question (From: Chris Suter <email@hidden>)

  • Prev by Date: Re: Autorelease question
  • Next by Date: Re: NSAutoreleasePool causes crashes when empty?
  • Previous by thread: Re: Autorelease question
  • Next by thread: Re: Autorelease question
  • Index(es):
    • Date
    • Thread