Explain

Can someone explain me the following statement in detail:

NSDate *now = [NSDate date];

Thanks in advance.
That's Objective C, this is a c/c++ website. C code can be called Objective C code as well, but Objective C code cannot be called C code. You need to find yourself a tutorial somewhere or ask this on stackoverflow
Ok I will ask in a different way.

Dog *fido = nil;
Newspaper *daily = [fido goGetTheNewspaper];

In above two lines of code I would like to know following:
1) what is dog and newspaper.
2) what is fido and daily.

Thanks in advance.
Last edited on
Dog and Newspaper are types of objects.
http://www.cplusplus.com/doc/tutorial/variables/

fido and daily are references to objects of the respective types. In C/C++ we call these references, pointers.

So fido is a reference of type Dog and daily is a reference of type Newspaper. fido is set to a value nil or zero. So the object referenced by fido is Empty or doesn't exist. We call fido a null reference

daily is set to the value of the function goGetTheNewspaper so depending on what is returned by that function, the object referenced by daily will either be Empty (in which case daily is a null reference) or contain something.

You might want to take these terms I've used and try to understand them in objective C. Maybe now you can ask a more specific question on stackoverflow
Got it now. Thanks a lot for explaining in detail.
Topic archived. No new replies allowed.