当任何 iOS 应用程序启动时,首先调用哪个方法和函数?
当任何 iOS 应用程序启动时,首先调用哪个方法和函数?
Which method and function is called first when any iOS application start ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
当任何 iOS 应用程序启动时,首先调用哪个方法和函数?
Which method and function is called first when any iOS application start ?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(6)
我想它
在
main.m
文件中,但出于实际目的,我认为您通常需要实现一些 UIApplicationDelegate 的方法,具体取决于情况:
I suppose its
in
main.m
fileBut for practical purposes I think you usually need to implement some of the UIApplicationDelegate's methods, depending on situation:
如果 View 启动,则为:
如果 app 启动,则为:
或者
我认为您最好使用 ViewDidLoad 方法。
我希望我有所帮助!
If A View starts up, then it's:
If an app starts up it's:
or
I think you'l be better of using the ViewDidLoad Method.
I hope i helped!
实际上:
出现在:之前
actually:
comes before:
应用启动期间调用的第一个函数
int main(int argc, char *argv[])
应用启动期间调用的第一个方法
application( _:willFinishLaunchingWithOptions:)
UIKit 处理大部分应用程序启动任务。
参考 - https://developer. apple.com/documentation/uikit/app_and_environment/responding_to_the_launch_of_your_app/about_the_app_launch_sequence
First function called during app launch
int main(int argc, char *argv[])
First method called during app launch
application(_:willFinishLaunchingWithOptions:)
UIKit handle most of app launch tasks.
Reference - https://developer.apple.com/documentation/uikit/app_and_environment/responding_to_the_launch_of_your_app/about_the_app_launch_sequence
当应用程序启动时,首先 application:didFinishLaunchingWithOptions:
方法被调用。
视图启动后
,viewDidLoad 被执行;
when application launches, first of all application:didFinishLaunchingWithOptions:
method is called..
After when view is launched
at that time viewDidLoad is executed;
查看图像根据苹果文档
之前被调用
Have look at image According to apple doc
gets called before