I am pretty much sure they do… but just wanted to confirm… for instance look at the following code..
- (void)reset {
NSNumber *zero = [NSNumber numberWithInteger:0];
[self setCount:zero];
}
now this returns an autoreleased object which gets added to the autorelease pool of the app and thus increasing its size…
and this will not be freed unless the app is terminated..?
Any help is appreciated
The memory is freed the next pass through the application’s main event loop.
The exact time depends on when your application finishes executing your code and returns to the event loop. It’s during the event loop that, among the tasks that are scheduled, is emptying (draining) the application’s autorelease pool.
If you’re concerned about autorelease pools gaining in size, you could employ your own autorelease pools strategically.