美文网首页iOS 奇闻轶事
Objective-C nil / Nil / NULL / N

Objective-C nil / Nil / NULL / N

作者: 凌巅 | 来源:发表于2016-10-30 12:31 被阅读58次

    Objective-C nil / Nil / NULL / NSNull 和 BOOL / bool / Boolean / NSCFBoolean

    nil / Nil / NULL / NSNull
    标志 含义
    nil id(0) Objective-C 对象的字面零值
    Nil Class(0) Objective-C 类的字面零值
    NULL void(0) C指针的字面零值
    NSNull [NSNull null] 零值得单独对象(有作没有),区别于Nil
    BOOL / bool / Boolean / NSCFBoolean
    名字 类型 真值 假值
    BOOL signed char YES NO
    bool _Bool(int) true false
    Boolean unsigned char TRUE FALSE
    NSNumber __NSCFBoolean @(YES) @(NO)
    CFBooleanRef struct kCFBooleanTrue kCFBooleanFalse

    相关文章

      网友评论

        本文标题:Objective-C nil / Nil / NULL / N

        本文链接:https://www.haomeiwen.com/subject/vukyuttx.html