Oc,nil,null,nil,kcfnull

Source: Internet
Author: User

Yymodel Source has a sentence: Kcfnull

//parse the Model property and attach a value+ (Instancetype) yy_modelwithdictionary: (Nsdictionary *) Dictionary {if(!dictionary | | dictionary = = (ID) kcfnull)returnNil; if(! [Dictionary Iskindofclass:[nsdictionaryclass]])returnNil; Class CLS= [Selfclass]; //Parse class to get Modelmeta object_yymodelmeta *modelmeta =[_yymodelmeta Metawithclass:cls]; //Local class type mapping    if(modelmeta->_hascustomclassfromdictionary) {CLS= [CLS Modelcustomclassfordictionary:dictionary]?: CLS; } nsobject*one = [CLSNew]; //value-attached functions    if([one yy_modelsetwithdictionary:dictionary])returnOne ; returnNil;}

Nil:define the ID of a null instance, which points to a null pointer to an (instance) object

such as: nsstring *str = nil;

NSDate *date = nil;

Nil:defines the ID of a null class, pointing to a null pointer to a class

Class class = Nil;

NULL: Defines a null pointer for other types (base type, C type)

char *p = NILL;

NSNull: Placeholder for an element in an array, the element in the data cannot be nil (can be empty, that is, NSNull)

Cause: Nil is the end of the group ID

If nil is used, the number of k in the n array, the length of which is only a k element.

  

A single case of Kcfnull:nsnull

There is a definition of kcfnull in corefoundation, which is actually a single case of NSNull

typedef const struct CF_BRIDGED_TYPE (NSNull) __cfnull *cfnullref;

Cf_export

Cftypeid Cfnullgettypeid (void);

Cf_export

Const CFNULLREF Kcfnull;//the Singleton NULL instance

NSNull *NULL1 = (id) kcfnull;

NSNull *null2 = [NSNull null];

Oc,nil,null,nil,kcfnull

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.