Re: Newbie with stupid question cont.
Re: Newbie with stupid question cont.
- Subject: Re: Newbie with stupid question cont.
- From: Ondra Cada <email@hidden>
- Date: Tue, 19 Mar 2002 18:21:33 +0100
On Tuesday, March 19, 2002, at 04:42 , Don Rainwater wrote:
For a really high loop count, would there be any benefit to something
like:
NSAutoreleasePool *pool;
pool = [[NSAutoreleasePool alloc] init];
for (x = 1; x <= highLoopLimit; x++) {
if (!(x % poolLimit)) {
[pool release];
pool = [[NSAutoreleasePool alloc] init];
}
...
}
[pool release];
right, it's even better. Though as rarely needed in practice that it is no
thing to be shown to newbies ;)
For experienced programmers this can sometimes come handy, just like the
alternative non-pool approach of
id foo=nil;
NS_DURING
[[Foo alloc] init];
...
...
NS_HANDLER
...
NS_ENDHANDLER
[foo release];
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
2K Development: email@hidden
http://www.2kdevelopment.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.