AppDelegate 中的 didFinishLaunchingWithOptions 参数是啥

     2023-02-23     213

关键词:

【中文标题】AppDelegate 中的 didFinishLaunchingWithOptions 参数是啥【英文标题】:What is didFinishLaunchingWithOptions argument in AppDelegateAppDelegate 中的 didFinishLaunchingWithOptions 参数是什么 【发布时间】:2016-04-24 15:35:35 【问题描述】:

在AppDelegate -> 应用函数中,“didFinishLaunchingWithOptions”是什么意思?它是传递给应用程序方法的函数吗?

【问题讨论】:

您可以从这里获得一些信息:nshipster.com/launch-options。或developer.apple.com/library/ios/documentation/UIKit/Reference/…: 您读过UIApplicationDelegate 文档吗?一切都在那里描述。轻松访问是Quick Help 或⌥-单击符号。 【参考方案1】:

AppDelegate 是一个协议。您需要向系统提供一个符合该协议并充当应用程序委托的对象。系统调用app delegate的各种方法,包括application :didFinishLaunchingWithOptions方法。

(Objective-C)方法签名如下所示:

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

在 Xcode 文档中搜索“didFinishLaunchingWithOptions”以了解它。

所以要回答您的问题,didFinishLaunchingWithOptions 是一种方法/函数,而不是“参数”。

系统可能会传入一个字典,其中包含有关应用程序如何启动的信息。 (来自本地通知、打开文件的请求、核心位置区域通知等)Xcode 文档有更多信息。

【讨论】:

appdelegate 中的 NSURLSessionDataTask

】appdelegate中的NSURLSessionDataTask【英文标题】:NSURLSessionDataTaskinappdelegate【发布时间】:2016-04-1617:37:17【问题描述】:当应用程序从邮件打开时,我会在appDelegate中调用NSURLSessionDataTask,所以在这个函数中-(BOOL)application:(UIApplication*... 查看详情

AppDelegate 中的 didFinishLaunchingWithOptions 参数是啥

】AppDelegate中的didFinishLaunchingWithOptions参数是啥【英文标题】:WhatisdidFinishLaunchingWithOptionsargumentinAppDelegateAppDelegate中的didFinishLaunchingWithOptions参数是什么【发布时间】:2016-04-2415:35:35【问题描述】:在AppDelegate->应用函数中,“d... 查看详情

为啥 AppDelegate 中的窗口为零

】为啥AppDelegate中的窗口为零【英文标题】:WhywindowisnilinAppDelegate为什么AppDelegate中的窗口为零【发布时间】:2014-11-2319:15:33【问题描述】:我需要从AppDelegate呈现视图控制器,所以我写了以下代码:letstoryboard=UIStoryboard(name:"Main",... 查看详情

更新 appDelegate 中的变量

】更新appDelegate中的变量【英文标题】:updatingavariableinappDelegate【发布时间】:2009-11-0916:49:14【问题描述】:在应用程序委托中,我创建了一个数组供多个视图控制器引用。但是,当我尝试在一个视图中更新数组时,它在另一个... 查看详情

从 AppDelegate 中的 ViewController 获取参数。

】从AppDelegate中的ViewController获取参数。【英文标题】:GetparamfromViewControllerinAppDelegate.【发布时间】:2014-03-2301:20:36【问题描述】:我需要在AppDelegate中获取某个ViewController的一个参数。它不是AppDelegate的根。什么是更快的方法呢... 查看详情

Appdelegate.swift 中的调用函数

】Appdelegate.swift中的调用函数【英文标题】:callfunctioninAppdelegate.swift【发布时间】:2015-05-1414:30:37【问题描述】:我在gamescene.swift中有这个功能:funcpauseGame()scene!.view!.paused=trueprintln("pause")updateScoreTimer.invalidate()现在我想从AppDelega... 查看详情

从 ViewController 访问 AppDelegate 中的对象

】从ViewController访问AppDelegate中的对象【英文标题】:AccessobjectinAppDelegatefromViewController【发布时间】:2019-05-2714:42:57【问题描述】:在AppDelegate.swift中,我声明了一个NSStatusBar对象,如下所示:varstatusItem=NSStatusBar.system.statusItem(with... 查看详情

如何在 AppDelegate 中的 didreceiveRemoteNotification 中处理远程推送通知

】如何在AppDelegate中的didreceiveRemoteNotification中处理远程推送通知【英文标题】:HowtohandleRemotepushnotificationsindidreceiveRemoteNotificationinAppDelegate【发布时间】:2015-09-2311:43:20【问题描述】:对于我的远程推送通知,我在AppDelegate中有... 查看详情

IOS 从 AppDelegate 中的 addMessageFromRemoteNotification 显示 UIViewController

】IOS从AppDelegate中的addMessageFromRemoteNotification显示UIViewController【英文标题】:IOSshowUIViewControllerfromaddMessageFromRemoteNotificationinAppDelegate【发布时间】:2015-06-0209:50:04【问题描述】:如何在AppDelegate中显示addMessageFromRemoteNoti 查看详情

UIApplication 中的窗口和 AppDelegate 中的窗口是啥关系?

】UIApplication中的窗口和AppDelegate中的窗口是啥关系?【英文标题】:WhatistherelationshipbetweenthewindowsinUIApplicationandwindowinAppDelegate?UIApplication中的窗口和AppDelegate中的窗口是什么关系?【发布时间】:2018-06-2516:51:34【问题描述】:在... 查看详情

iOS tabBarController 检测 AppDelegate 中的选定索引

】iOStabBarController检测AppDelegate中的选定索引【英文标题】:iOStabBarControllerdetectselectedindexinAppDelegate【发布时间】:2015-02-2215:23:20【问题描述】:AppDelegate.h*****@interfaceAppDelegate:UIResponder<UIApplicationDelegate,UITabBarContro 查看详情

未调用 appdelegate 中的 clickedButtonAtIndex

】未调用appdelegate中的clickedButtonAtIndex【英文标题】:clickedButtonAtIndexinappdelegateisnotcalled【发布时间】:2011-08-1113:53:25【问题描述】:我在MyapplicationAppDelegate.m文件中使用2个按钮“取消”和“确定”调用UIAlert,警报被调用但点击... 查看详情

appdelegate 中的 UIButton 外观层不起作用

】appdelegate中的UIButton外观层不起作用【英文标题】:UIButtonappearancelayerinappdelegatenotworking【发布时间】:2013-12-3004:45:51【问题描述】:我想把应用中的所有按钮都做成圆角按钮。但UIButton的外观不会改变appdelegate中的图层属性:[[[... 查看详情

AppDelegate 中的 Swift UITabbar 阴影

】AppDelegate中的SwiftUITabbar阴影【英文标题】:SwiftUITabbarShadowinAppDelegate【发布时间】:2018-12-2407:38:41【问题描述】:我尝试将阴影应用到默认标签栏。我从研究中找到了一些代码,但它不起作用。我想将此代码放在AppDelegate中以... 查看详情

Swift:从 AppDelegate 中的 UNTextInputNotificationAction 获取内容

】Swift:从AppDelegate中的UNTextInputNotificationAction获取内容【英文标题】:Swift:GetcontentfromUNTextInputNotificationActioninAppDelegate【发布时间】:2018-07-1716:28:32【问题描述】:我正在使用Xcode9.4.1(9F2000)和Swift。我在AppDelegate中有这个代码:fun... 查看详情

类 AppDelegate: UIResponder, UIApplicationDelegate SWIFT 中的 SIGABIRT 错误

】类AppDelegate:UIResponder,UIApplicationDelegateSWIFT中的SIGABIRT错误【英文标题】:classAppDelegate:UIResponder,UIApplicationDelegateSIGABIRTERRORinSWIFT类AppDelegate:UIResponder,UIApplicationDelegateSWIFT中的SIGABIRT错误【发布时间】:2016-06-2 查看详情

AppDelegate Swift 中的 reloadData

】AppDelegateSwift中的reloadData【英文标题】:reloadDatainAppDelegateSwift【发布时间】:2015-06-2617:02:22【问题描述】:我的AppDelegate中有一个类似于DidReceiveRemoteNotification的函数,并且在收到消息后将消息附加到数组中,然后尝试重新加载... 查看详情

如何与 AppDelegate 中的特定视图交互?

】如何与AppDelegate中的特定视图交互?【英文标题】:HowcanIinteractwithspecificViewsfromtheAppDelegate?【发布时间】:2017-02-0103:30:04【问题描述】:我的appdelegate中有一个函数,它在通知触发时被调用。当调用此函数时,我希望能够访问... 查看详情