nullable:
作用:可能爲空,提示屬性可能爲空,爲了迎合swift(強語言)
好處:提高代碼規範,減少溝通成本
用法:可用於修飾屬性,參數和返回值
語法:@property(nonatomic,strong,nullable) NSString *name
語法2:@property(nonatomic,strong) NSString * _Nullable name
語法2:@property(nonatomic,strong) NSString * __nullable name
nonnull:
作用:提示不能爲空,僅僅是提供警告,並不會報錯
語法:同上
null_resetable:
作用:get方法返回值不能爲空,set方法可以傳入爲空
用法:必須要處理爲空的情況
語法:@property(nonatomic,strong,null_resettable) NSString *name
關鍵字不能用於基本數據類型