Objective-C - Private vs Protected vs Public

前端 未结 4 572
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-07 16:53

I am hoping for some clarification on how Private vs Protected vs Public works with respect to class members when programming in Objective-C - I thought I knew the differenc

4条回答
  •  遥遥无期
    2020-12-07 17:14

    You are setting the visibilities of the ivars, not the properties. Your properties generate public getter and setter methods.

    To make private properties, you can put the properties in a private category in the .m file.

提交回复
热议问题