If the UIApplicationMain() never returns then when does the autorelease pool gets released?
Posted
by sid
on Stack Overflow
See other posts from Stack Overflow
or by sid
Published on 2010-04-23T23:32:29Z
Indexed on
2010/04/23
23:43 UTC
Read the original article
Hit count: 391
For code:
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
}
Apple's doc clearly specifies:
Return Value: Even though an integer return type is specified, this function never returns. When users terminate an iPhone application by pressing the Home button, the application immediately exits by calling the exit system function with an argument of zero.
Secondly, in
int UIApplicationMain (
int argc,
char *argv[],
NSString *principalClassName,
NSString *delegateClassName
);
how can we access the argv from our UIApplication subclass?
© Stack Overflow or respective owner