Difference between setting a property directly and using its setter?

前端 未结 3 1286
轮回少年
轮回少年 2020-12-22 02:19

What is the difference between these two?

  • self.view.color = [UIColor redColor];
  • [self.view setColor:[UIColor redColor]];
3条回答
  •  天涯浪人
    2020-12-22 02:52

    Mainly it is a syntax issue, both call the same setter so you can use both equally depending which one you personally prefer :)

提交回复
热议问题