PDA

View Full Version : Nil and nil




xcodeNewbie
Jul 22, 2011, 03:02 PM
When I start typing "nil" in Xcode the auto-completion comes up with two options, "nil" and "Nil". I am wondering what the difference is between these two are? Thanks in advance.



chown33
Jul 22, 2011, 03:33 PM
I am wondering what the difference is between these two are?

Nil.


None. Nothing. Nonexistent. No difference.

jnoxx
Jul 23, 2011, 10:21 AM
Afaik, NULL, nil, null, Nil, are all the same.
I think 'nil' is the most common used.

admanimal
Jul 23, 2011, 12:23 PM
While they are the same, the generally accepted style is to use nil when dealing with any objective-c object types, and NULL if it's a (void *). In other words, nil is the correct Objective-C style, and NULL is the correct C style.

jiminaus
Jul 23, 2011, 09:04 PM
While they are the same, the generally accepted style is to use nil when dealing with any objective-c object types, and NULL if it's a (void *). In other words, nil is the correct Objective-C style, and NULL is the correct C style.

I second this.