zoukankan      html  css  js  c++  java
  • associated objects are released at the end of the life cycle

    f you want to actually see the description of the entire dealloc timeline, look at WWDC 2011, Session 322, 36:22. However, here's the basic rundown (I wanted to remember it, so this is an actual comment in a piece of my code).

    Note, that the associated objects are released at the end of the life cycle.

    // General Information
    // We take advantage of the documented Deallocation Timeline (WWDC 2011, Session 322, 36:22).
    // 1. -release to zero
    //     * Object is now deallocating and will die.
    //     * New __weak references are not allowed, and will get nil.
    //     * [self dealloc] is called
    // 2. Subclass -dealloc
    //     * bottom-most subclass -dealloc is called
    //     * Non-ARC code manually releases iVars
    //     * Walk the super-class chain calling -dealloc
    // 3. NSObject -dealloc
    //     * Simply calls the ObjC runtime object_dispose()
    // 4. object_dispose()
    //     * Call destructors for C++ iVars
    //     * Call -release for ARC iVars
    //     * Erase associated references
    //     * Erase __weak references
    //     * Call free()
  • 相关阅读:
    第二章、Redis入门介绍
    最高的牛
    增减序列
    激光炸弹
    分形之城
    约数之和
    奇怪的汉诺塔
    费解的开关
    递归实现排列型枚举
    递归实现组合型枚举
  • 原文地址:https://www.cnblogs.com/qq378829867/p/9873424.html
Copyright © 2011-2022 走看看