*?
*?
- Subject: *?
- From: email@hidden
- Date: Fri, 22 Jun 2001 14:06:48 -0400
I keep running into things like:
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
and:
- (NSString *)airports;
- (void)setAirports:(NSString *)str;
Now, I understand the use of the * in:
NSMutableArray *myArray;
which says that myArray is of type "NSMutableArray" instead of generic
type "id". But there is no explanation that I can find as to what the *
does or means in the first two examples. My copy of Kernighan and
Ritchie just came and I looked there, but all I could find was a usage
somewhat similar on page 94 that uses the * to indicate that an argument
is a pointer to a type. So, all I can guess is that in the example:
- (NSString *)airports;
the * is shorthand for statically typing "airport" to NSString. Is that
right? If so, then in the second line:
- (void)setAirports:(NSString *)str;
"str" is statically typed to NSString also?
As for the first example:
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
is this the same as:
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];?
Is the space between the * and "pool" optional? If so is there some
reason to use the extra space in this construction?
Sorry for the no doubt low level questions, but I'm trying to understand
this stuff and explanations are just not in the docs--or if they are I
have not been able to root them out.
Brian E. Howard
Cocoa Cult Central
trying to keep six reference books open at the same time!
- Follow-Ups:
- Re: *?
- From: Rosyna <email@hidden>
- Re: *?
- From: "David P. Henderson" <email@hidden>
- Re: *?
- From: "Dennis C. De Mars" <email@hidden>
- Re: *?
- Re: *?
- From: Finlay Dobbie <email@hidden>