Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • nil, NULL, Nil, NSNull in objective c

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 345
    Comment on it

    4 kind of zeros are used in objective c - nil, Nil, NULL and NSNull. All of these are different with their properties. Usually in programming nil and NSNull are used in objective c and NULL is used with c/c++ statements. Type of nil is defined as "id"(object in objective c) and NULL as "void *".NSNull worked as an object when nil is not allowed.

    NULL has a value of (void *)0 and used for null value for C pointers.
    nil has a value of (id)0 and used for null value for Objective-C objects.
    Nil has a value of (Class)0 and used for null value for Objective-C classes.
    NSNull has a value of [NSNull null] and used for singleton object used to represent null.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: