As @DavidKanarek says, you will have leaks.
There are several ways to fix these leaks:
NSDate* someDate; someDate=[NSDate date]; loop { someDate=[NSDate date]; }
or
NSDate* someDate=nil; someDate=[[NSDate alloc] init]; loop { [someDate release]; someDate=[[NSDate alloc] init]; } [someDate release];
The first of these is simple code to read, but the second helps reduce memory consumption. If your cycle is not too big, use the first one. If you go through the cycle a thousand times, I would use the second.
Sam
source share