#pragma mark--nullable
Nullable: Can be empty, only adornment object, cannot decorate basic data type
Way One:
@property (nonatomic, copy, nullable) NSString *name;
Way two:
@property (nonatomic, copy) nsstring *_nullable name;
Way three:
@property (nonatomic, copy) nsstring *__nullable name;
Method in
-(Nullable NSString *) Test: (Nullable NSString *) str;
-(NSString * _nullable) Test1: (NSString * _nullable) str;
#pragma mark--nonnull
Nonnull: cannot be empty, can only decorate object, cannot decorate base data type
Way One:
@property (nonatomic, copy, nonnull) NSString *name;
Way two:
@property (nonatomic, copy) NSString * _nonnull name;
Way three:
@property (nonatomic, copy) NSString * __nonnull name;
Method in
-(nonnull NSString *) Test: (nonnull nsstring *) str;
-(NSString * _nonnull) Test1: (NSString * _nonnull) str;
#pragma mark--null_resettable
Null_resettable:get: Cannot return null, set can be empty
@property (nonatomic, copy, null_resettable) NSString *name;
Note: If you use Null_resettable, you must override the Get method or set method to handle the case where the passed value is empty
#pragma mark--_null_unspecified
_null_unspecified: Not sure whether it is empty
Way One
@property (nonatomic, copy) nsstring *_null_unspecified name;
Way Two
@property (nonatomic, copy) nsstring *__null_unspecified name;
#pragma mark-Generics
@property (nonatomic, strong) nsmutablearray<nsstring *> *arraym;
Indicates that the object stored in the Arraym array can only be an object of type NSString
Develop specifications, remove objects from arrays, use directly as generic objects, and use point syntax directly to improve development efficiency
#pragma mark--__kindof
__kindof Person *: Indicates that the return value can be the person class or its subclass, and it is clear that the type of the return value is available when used outside
+ (__kindof person *) person;
Have any questions about iOS development! Welcome to the message below!!! or email [email protected] Although I'm not sure I can answer it, I'll ask iOS developers!!! Answers to your questions!!!
Common keywords, generics for new features of IOS9