I am having doubts on when an autoreleased object. WHen I found this question,
In the thread's accepted answer, the below explanation is provided for the runloop execution:
void int UIApplicationMain (int argc, char *argv[], NSString *principalClassName, NSString *delegateClassName) {
UIApplication *app = /* create app using principalClassName */;
[app setDelegate:/* create delegate using delegateClassName */];
while (![app shouldTerminate]) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
event = [app getNextEvent];
[app dispatchEvent:event];
[pool drain];
}
}
Is this how runloop execution occurs?
And does it mean on each execution of runloop, a new autorelease pool will be created and released.