Should @synthesize be used still?

前端 未结 4 489
一生所求
一生所求 2021-01-19 02:20

I\'m just wondering if @synthesize should still be used even though Xcode does it automatically for properties, simply because it\'s been done that way for so long? Or does

4条回答
  •  孤城傲影
    2021-01-19 03:06

    If you are ok with your ivar being synthesized with _propertyName you can safely get rid of the synthesize statements. If you want your ivar to be named something else, you need to include it like so

    @synthesize propertyName = ________cool_ivar_name
    

提交回复
热议问题