Very simple question - need answer to :)


#1

Hi guys.

In this line " - (NSString *) description "

I understand that NSString returns a string, but what is the point of the asterisk? I’m assuming its a pointer? Why does it need it? (float), (int) doesn’t require that so why is it used in (NSString *)?


#2

Hi,

I think you might want to go back and review the chapter on pointers and addresses.

In english, the line says “The instance method description returns a pointer to an instance of NSString.” The asterisk is how you know it is a pointer.


#3

Is the pointer then, in this case, “description” ?

I thought pointers were ‘variables’. ‘description’ is an instance method of (NSOBject).


#4

To be precise: the method description is defined as returning a string object, and in Objective-C all objects are stored in pointer variables.