xcode applicationDidFinishLaunching 函数在哪里?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7151378/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 21:47:12  来源:igfitidea点击:

Where is the applicationDidFinishLaunching function?

xcode

提问by Phillip Senn

My documentation says:

我的文档说:

Add the codes below into the applicationDidFinishLaunching function... -(void)applicationDidFinishLaunching:(UIApplication *)application{

将以下代码添加到 applicationDidFinishLaunching 函数中... -(void)applicationDidFinishLaunching:(UIApplication *)application{

But I only see

但我只看到

-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

Q: Are these two the same?

问:这两个是一样的吗?

If not, where do I find the applicaitonDidFinishLaunching function?

如果没有,我在哪里可以找到 applicaitonDidFinishLaunching 函数?

回答by superjessi

Per the Apple documentation:

根据 Apple 文档:

applicationDidFinishLaunching:

Tells the delegate when the application has finished launching.

当应用程序完成启动时告诉委托。

-(void)applicationDidFinishLaunching:(UIApplication *)application

This method is used in earlier versions of iOS to initialize the application and prepare it to run. In iOS 3.0 and later, you should use the application:didFinishLaunchingWithOptions:instead.

此方法在早期版本的 iOS 中用于初始化应用程序并准备运行。在 iOS 3.0 及更高版本中,您应该使用application:didFinishLaunchingWithOptions:代替。

回答by Cyrille

These are the same. The options have been added in the 4.0 SDK if I recall correctly.

这些都是一样的。如果我没记错的话,这些选项已添加到 4.0 SDK 中。

Edit: it's been there since 3.0: http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIApplicationDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intf/UIApplicationDelegate

编辑:它自 3.0 以来一直存在:http: //developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIApplicationDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intf/UIApplicationDelegate