• 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: What's up with UI interaction and NSMutableArray+NSAutoReleasePop()?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What's up with UI interaction and NSMutableArray+NSAutoReleasePop()?


  • Subject: Re: What's up with UI interaction and NSMutableArray+NSAutoReleasePop()?
  • From: Guy English <email@hidden>
  • Date: Mon, 21 Mar 2005 13:45:02 -0500

Autorelease pools are emptied by the event loop. If you're blocked
waiting for an event ( as you would be if the UI isn't being touched )
then the pool will never empty. To get finer grained control of your
autoreleased objects just add your own autorelease pool.

> - (void)addObjectTask:(NSTimer*)timer {

            NSAutoreleasePool *pool;
           pool = [[NSAutoreleasePool alloc] init];

>         MyObject* anObject = [MyObject new];
>         [sArray addObject:anObject];
>         [anObject release];
>         [anObject fetch:@"http://www.heynow.com";];

           [pool release];

> }

When the pool is released all the objects go with it.

Take care,
Guy
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >What's up with UI interaction and NSMutableArray+NSAutoReleasePop()? (From: Jay Koutavas <email@hidden>)

  • Prev by Date: Re: command line arguments
  • Next by Date: Simple Prog. w/ AU (Audio Units)
  • Previous by thread: What's up with UI interaction and NSMutableArray+NSAutoReleasePop()?
  • Next by thread: Image Resolution problem in NSBitmapImageRep
  • Index(es):
    • Date
    • Thread