property修饰关键字



修饰符按作用区分:线程安全相关,内存相关,读写权限相关,set=和get=,是否可为空, class

一.默认值

@property NSArray *dataArray;

默认的是:atomic,strong(引用类型是strong, 值类型是assign),readwrite,nullable


二.线程相关

  • atomic
  • nonatomic


三.内存相关


四.读写权限

  • readwrite
  • readonly

五.set=和get=

  • set=
  • get=

六.空与非空

  • nonnull
  • nullable
  • null_resettable
  • null_unspecified

七.class

  • class

原文地址:https://www.cnblogs.com/shidaying/p/6960156.html