Re: What's up with UI interaction and NSMutableArray+NSAutoReleasePop()?
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