didFinishLaunchingWithOptions方法,该方法仅创建自定义UIViewController

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了didFinishLaunchingWithOptions方法,该方法仅创建自定义UIViewController相关的知识,希望对你有一定的参考价值。

Inside the `AppDelegate`, the `didFinishLaunchingWithOptions` method can be used to just create and use a custom View Controller class.
  1. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  2.  
  3. // create an instance of the view controller
  4. MyViewController *vc = [[MyViewController alloc] init];
  5.  
  6. // add the view controllers view to the window
  7. [window addSubview:[vc view]];
  8.  
  9. // release vc (we're done with it)
  10. [vc release];
  11.  
  12. // make key and visible of course!
  13. [window makeKeyAndVisible];
  14.  
  15. // happy times
  16. return YES;
  17. }

以上是关于didFinishLaunchingWithOptions方法,该方法仅创建自定义UIViewController的主要内容,如果未能解决你的问题,请参考以下文章

如何对 didFinishLaunchingWithOptions 进行单元测试?

为啥要在 didFinishLaunchingWithOptions 中使用 UIApplicationLaunchOptionsRemoteNotificationKey?

如何在 didFinishLaunchingWithOptions 中测试 UILocalNotification

应用程序 didFinishLaunchingWithOptions 没有被调用

application:didFinishLaunchingWithOptions:

如何在处理通用链接之前等待 didFinishLaunchingWithOptions 完成?