Differences between strong and weak in Objective-C

后端 未结 9 1247
礼貌的吻别
礼貌的吻别 2020-11-22 08:09

I\'m new to Obj-C, so my first question is:

What are the differences between strong and weak in @property declarations of poin

9条回答
  •  孤街浪徒
    2020-11-22 08:30

    strong is the default. An object remains “alive” as long as there is a strong pointer to it.

    weak specifies a reference that does not keep the referenced object alive. A weak reference is set to nil when there are no strong references to the object.

提交回复
热议问题