I know these question sounds really stupid or easy to you guys but i'm still kind of blurry here. Hope that you guys can clear out my doubts and help me have a firm grasp on this concept.
NSHost *instance = [NSHost currentHost];
NSString *answer = [instance localizedName];
NSLog(@"%@",answer);
For the first line of code,
Does currentHost method of NSHost
class return address of the instances OR all method of class return address of its instances? I should ask what does [NSHost currentHost]
returns.
For the 2nd line of code,
Can you store a pointer in a variable? Since localizedName
returns a pointer, then storing pointer in a variable(variable answer) is like storing a variable in a variable because pointer is also a variable when we first set it.I am saying this because the book I am reading says that localizedName
returns a pointer to an instance of NSString.