0
int main(int argc, char *argv[])
{
   NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
   int retVal = UIApplicationMain(argc, argv, nil, nil);
   [pool release];
   return retVal;
}
  1. UIApplicationMain() 调用只会在我们的应用程序执行完成后返回吗?因为我有下一行 [pool release]

  2. 如何在 main() 中传递命令行参数?

  3. UIApplicationMain() 将返回的可能 int 值及其状态是什么?

4

1 回答 1

2

UIApplicationMain() 调用只会在我们的应用程序执行完成后返回吗?因为我有下一行 [pool release]

UIApplicationMain()永远不会回来。和[pool release]只是return为了审美平衡。

如何在 main() 中传递命令行参数?

命令行参数已经存在于argv. 您可以在UIApplicationMain(). 如果您的意思是“我如何在外部访问它们main()”,请参阅NSProcessInfo。这在 iOS 中通常不是很有用。

UIApplicationMain() 将返回的可能 int 值及其状态是什么?

没有了。请参阅UIKit 函数参考

于 2013-04-06T02:31:06.553 回答