• 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: Retained items and autorelease pool
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Retained items and autorelease pool


  • Subject: Re: Retained items and autorelease pool
  • From: "Erik M. Buck" <email@hidden>
  • Date: Tue, 7 Aug 2001 13:54:06 -0500

> NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
> ... much code here...
> ... in some subroutine somewhere:
> // myString is a loose global variable, not a class member of
> anything
> myString = [[NSString stringWithCString:someString] retain];
> ... much other code here ...
> ... back in earlier routine:
> [pool release];
>
> Did I just lose myString? If so, how do I allocate things that don't get
> cleaned up by releasing the pool?

You do not loose myString because it was never in pool because it was never
autoreleased. This is not hard stuff. RTFM.


  • Follow-Ups:
    • Localizing
      • From: Rosyna <email@hidden>
    • Re: Retained items and autorelease pool
      • From: Carlos Weber <email@hidden>
  • Prev by Date: Re: Admin programs and password
  • Next by Date: Re: NSProgressIndicator and other controls in a cell in an NSTableView
  • Previous by thread: Retained items and autorelease pool
  • Next by thread: Re: Retained items and autorelease pool
  • Index(es):
    • Date
    • Thread