Wednesday, 3 October 2012

Difference between Nil , nil and NULL

Difference between Nil , nil and NULL


nil is a null pointer to an Objective-C object
Nil is a null pointer to an Objective-C class. 
NULL is  a null pointer to anything else
 Actually all the three have the numeric value of 0.
  • nil == (id) 0 
  • Nil == (Class) 0 
  • NULL == (void *) 0 

simply can say that nil is a pointer to an object
    for example : 
     NSArray *array = [NSArray arrayWithObjects:@"karthik", @"prabhu", nil];

4 comments:

  1. nice blogs.
    Friend chatMake new friend’s without revealing yourself. Dial 543216 at Rs 2/min and monthly subscription of Rs 30/ 30 days.

    ReplyDelete
  2. Thanks for sharing this blog with us...
    Hvantage Technologies offer best Mobile app development and Web Development Services with affordable price. If anyone is required for these services visit as: www.hvantagetechnologies.com

    ReplyDelete
  3. Thanks for the post, you have provided a simple step by step process so anyone can understand easily. For understanding Mobile Application Services and Android Development, you can visit Yberry Infosystem in Indore Visit: www.yberryinfosystem.com

    ReplyDelete