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.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // create an instance of the view controller MyViewController *vc = [[MyViewController alloc] init]; // add the view controllers view to the window [window addSubview:[vc view]]; // release vc (we're done with it) [vc release]; // make key and visible of course! [window makeKeyAndVisible]; // happy times return YES; }
以上是关于didFinishLaunchingWithOptions方法,该方法仅创建自定义UIViewController的主要内容,如果未能解决你的问题,请参考以下文章
如何对 didFinishLaunchingWithOptions 进行单元测试?
为啥要在 didFinishLaunchingWithOptions 中使用 UIApplicationLaunchOptionsRemoteNotificationKey?
如何在 didFinishLaunchingWithOptions 中测试 UILocalNotification
应用程序 didFinishLaunchingWithOptions 没有被调用