With ARC why use @properties anymore?

前端 未结 5 1481
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-29 10:25

In non-ARC code retained properties handily take care of memory management for you using the self.property = syntax, so we were taught to use them for practical

5条回答
  •  孤城傲影
    2020-12-29 11:01

    I don't think I've ever used properties simply because of memory management and I don't think you ever should. So to answer your question, no, there's no reason to use properties other than to access instance variables, which is essentially what they're supposed to be used for in the first place.

提交回复
热议问题