Difference between nil, NIL and, null in Objective-C

nil is the literal null value for Objective-C objects, corresponding to the abstract type id or any Objective-C type declared via @interface. For instance: Nil is the literal null value for Objective-C classes, corresponding to the type Class. Since most code doesn’t need variables to reference classes, its use is not common. One example is: … Read more

What is the meaning of id?

id is a pointer to any type, but unlike void * it always points to an Objective-C object. For example, you can add anything of type id to an NSArray, but those objects must respond to retain and release. The compiler is totally happy for you to implicitly cast any object to id, and for you to cast id to any object. This is unlike any … Read more

Compiler error: “initializer element is not a compile-time constant”

When you define a variable outside the scope of a function, that variable’s value is actually written into your executable file. This means you can only use a constant value. Since you don’t know everything about the runtime environment at compile time (which classes are available, what is their structure, etc.), you cannot create objective … Read more

printf(“%%%s”,”hello”)

The compiler simply interprets this as calling printf with two strings as arguments (but see Zack’s comment). This happens at compile time (i.e. the compiler does this): The strings (“%%%s” and “hello”) are copied directly into the executable, the compiler leaves them as-is. This happens at runtime (i.e. the C standard library does this when the app is running): … Read more

Difference between nil, NIL and, null in Objective-C

nil is the literal null value for Objective-C objects, corresponding to the abstract type id or any Objective-C type declared via @interface. For instance: Nil is the literal null value for Objective-C classes, corresponding to the type Class. Since most code doesn’t need variables to reference classes, its use is not common. One example is: NULL is the literal null value for … Read more

What does \0 stand for?

Possible Duplicate:What does the \0 symbol mean in a C string? I am new at iPhone Development. I want to know, what does ‘\0’ means in C, and what is the equivalent for that in objective c.