Skip to content

关于23点问题。 #2

@maquannene

Description

@maquannene
  1. 使用runtime Associate方法关联的对象,需要在主对象dealloc的时候释放么?
    在ARC下不需要
    在MRC中,对于使用retain或copy策略的需要

MRC下,如果A 关联了B 对象,保证在objc_setAssociatedObject后B对象只有A持有,即B.retainCount = 1的情况下,释放A对象,关联的B对象应该会释放吧。

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