Re: Confusion
Re: Confusion
- Subject: Re: Confusion
- From: Brian Howard <email@hidden>
- Date: Sun, 24 Jun 2001 16:54:52 -0400
On Sunday, June 24, 2001, at 03:20 PM, Michael P. Rogers wrote:
At 1:51 PM -0400 6/24/01, email@hidden wrote:
If I declare:
NSString *myName;
I am stating that myName is of type NSString.
No, you're declaring that myName is a _pointer_ to NSString. It might
help if, when reading Cocoa, you actually pronounce the * as "points
to", or "pointer". So the above declares myName as an "NSString
pointer".
Jeez, I hate to get snippy here, and some of the other things you said
seem to make sense, but on page 61 of Apple's "Object-Oriented
Programming and the Objective-C language" it states:
"YOU CAN USE A CLASS NAME IN PLACE OF ID TO DESIGNATE AN OBJECT'S TYPE:
Rectangle *myRect;"
So, if I get this right, we are both right in that from one viewpoint
I'm telling the compiler myName is of type NSString, and from another
viewpoint myName is a pointer telling the compiler were to find out what
type myName is. Is that right? Six of one and half-a-dozen of another?
Brian E. Howard
Cocoa Cult Central
maybe another step forward?