Skip to content

说一下控制器 View 的生命周期,一旦收到内存警告会如何处理? #129

@tbfungeek

Description

@tbfungeek

当系统内存告急时,会接收到didReceiveMemoryWarning。 这是属于 ViewController 的方法,当ViewController 接收到didReceiveMemoryWarning,首先会判断当前的 ViewController 是否还显示在 window上,如果不在就会移除当前的 ViewController,销毁ViewController 上面的子控件,并执行 ViewDidUnload 方法。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions