gpt4 book ai didi

iphone - 如果 UIApplicationMain() 永远不会返回,那么自动释放池什么时候被释放?

转载 作者:行者123 更新时间:2023-12-03 16:12:20 26 4
gpt4 key购买 nike

代码:

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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com