相当于iOS中的活动生命周期? [英] What the equivalent of activity life cycle in iOS?

查看:153
本文介绍了相当于iOS中的活动生命周期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实际上,我会说iOS ViewControllers 和Android Activities 都有自己的生命周期方法。例如, ViewController.viewDidLoad()的等价物是 Activity.onCreate()

Actually, I would say that both iOS ViewControllers and Android Activities have their lifecycle methods. For example an equivalent of ViewController.viewDidLoad() is Activity.onCreate() ?

否则我仍然需要知道对方的等价物:

Else I still need to know the equivalent of the other :


  • OnStart( )

  • OnRestart()

  • OnResume()

  • OnStop()

  • OnDestroy()

  • OnPause()

  • OnStart()
  • OnRestart()
  • OnResume()
  • OnStop()
  • OnDestroy()
  • OnPause()

推荐答案

这是Android与iOS生命周期的比较:

This is a comparison between the lifecycle of Android vs iOS:


  • 注意:在iOS 6之后不推荐使用viewDidUnload

  • Note: viewDidUnload is deprecated after iOS 6

这篇关于相当于iOS中的活动生命周期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆