ARC時代的copy等

  • assign implies __unsafe_unretained ownership.
  • copy implies __strong ownership, as well as the usual behavior of copy semantics on the setter.
  • retain implies __strong ownership.
  • strong implies __strong ownership.
  • unsafe_unretained implies __unsafe_unretained ownership.
  • weak implies __weak ownership.


assign 等同unsafe_unretained
retain 等同 strong

copy的效用和MRC同樣,同時又有strong的效果。 spa


ARC時代copy等不推薦使用的關鍵字能夠用在屬性中,而不能出如今方法調用中。 ip

相關文章
相關標籤/搜索