转自:@property和@synthesize

Objective-2.0开始,我们可以使用@property和@synthesize属性让系统自动生成setter和getter方法,在接口文件,也就是扩展名为.h的文件中使用@property来标识属性(一般是实例变量),在实现文件中,也就是扩展名为.m的文件中使用@synthesize标识所声明的属性,让系统自动生成setter和getter方法。

相关文章:

  • 2022-12-23
  • 2021-11-08
  • 2021-10-16
  • 2021-12-13
  • 2021-07-07
猜你喜欢
  • 2021-11-14
  • 2021-10-16
  • 2022-02-01
  • 2022-12-23
  • 2021-07-16
  • 2022-12-23
  • 2021-11-24
相关资源
相似解决方案