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

Autorelease question


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

Hi
How can I tell that default autorelease pool exists?
here is why I ask

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
and indeed, in the simple guiless Cocoa application
if I try to call, for example,
NSString *textString = [NSString stringWithCString:"Hello From Cocoa" encoding:NSMacOSRomanStringEncoding];
without cretaing NSAutoreleasePool
I'll get
2008-04-03 19:59:00.833 NSArrayTest[57600:10b] *** _NSAutoreleaseNoPool(): Object 0x1099e0 of class NSCFString autoreleased with no pool in place - just leaking


but from other hand in the complex Carbon application, where I never explicitly created NSAutoreleasePool object
I can call
NSString *textString = [NSString stringWithCString:"Hello From Cocoa" encoding:NSMacOSRomanStringEncoding];
without any warnings about _NSAutoreleaseNoPool


so I suppose default NSAutoreleasePool was created for me

so how I can verify it?

thanks


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: Adam Leonard <email@hidden>
    • Re: Autorelease question
      • From: "Hamish Allan" <email@hidden>
    • Re: Autorelease question
      • From: Robert Claeson <email@hidden>
  • Prev by Date: Re: More fun with C++
  • Next by Date: Re: Autorelease question
  • Previous by thread: Re: Basic XPath Question
  • Next by thread: Re: Autorelease question
  • Index(es):
    • Date
    • Thread