IOS9 New Keywords Nullable, nonnull, Null_unspecified, null_resettable

Source: Internet
Author: User

#import "ViewController.h"@interfaceViewcontroller () @property (nonatomic,nullable) NSString*name;//can be empty@property (nonatomic,nonnull) Nsstring*password;//cannot be empty@property (nonatomic,null_unspecified) nsstring*unkonw;//Unknown type@property (nonatomic) NSString* _nullable name1;//can be empty@property (nonatomic) nsstring* _nonnull Password1;//cannot be empty@property (nonatomic) nsstring* _null_unspecified UNKONW1;//Unknown type@property (nonatomic) NSString* __nullable name2;//can be empty@property (nonatomic) nsstring* __nonnull password2;//cannot be empty@property (nonatomic) nsstring* __null_unspecified unkonw2;//Unknown type@property (nonatomic,null_resettable) NSString*SETSTR;//The Get method cannot be empty, and the set method can be null-(void) Creatdemowithname: (Nullable nsstring*) name PSW: ( nsstring* _nonnull) PSW unkonwstr: (null_unspecified nsstring*) Unkownstr;@end@implementationViewcontroller- (void) viewdidload {[Super viewdidload]; [Self creatdemowithname:nil PSW:@"Heheheh"Unkonwstr:nil]; }-(void) Setsetstr: (NSString *) setstr{Self.setstr=@"hehehe"; }-(void) Creatdemowithname: (Nullable nsstring*) name PSW: ( nsstring* _nonnull) PSW unkonwstr: (null_unspecified nsstring*) unkownstr{NSLog (@"%@=%@=%@", NAME,PSW,UNKOWNSTR);}

IOS9 New Keywords Nullable, nonnull, Null_unspecified, null_resettable

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.