Does currentHost method of NSHost class return address of the instances or all method of class return address of its instances?<for the first line of code
2)Can you store a pointer in a variable? Since localizedName returns a pointer, then storing pointer in a variable is like storing a variable in a variable because pointer is also a variable when we first set it. < for 2nd line of code
the book says localizedName returns a pointer to an instance of NSString
[quote]1) Does currentHost method of NSHost class return address of the instances or all method of class return address of its instances?<for the first line of code
[/quote]
Class methods can return anything, not just instances.
That depends on the type of the variable. It has to be a compatible pointer variable or a variable of type void *.
[/quote]
Yes, you have an instance variable and an answer variable that just so happen to be pointers, which mean its pointing to a memory address and also containing data you initialized from the method(s): currentHost and localizedName…