代码:
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
}
Apple 的文档明确指出:
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.
其次,在
int UIApplicationMain (
整数argc,
字符*argv[],
NSString *principalClassName,
NSString *delegateClassName
);
我们如何从 UIApplication 子类访问 argv?
最佳答案
自动释放池没有被释放。相反,操作系统只是从内存中删除您的应用程序。
关于iphone - 如果 UIApplicationMain() 永远不会返回,那么自动释放池什么时候被释放?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2702548/