Re: *?
Re: *?
- Subject: Re: *?
- From: Russell Ahrens <email@hidden>
- Date: Fri, 22 Jun 2001 18:17:59 -0400
It should also be clarified that in any object oriented language, the
subclass of any class specified in the signature as the type of a
parameter can be substituted for the specific class mentioned.
That is to say, when calling
- (void)setAirports:(NSString *)str;
a value of class NSString or a value of a subclass of NSString can be
passed into setAirports. If your system/application/code defined a
class "MyAirportSpecializedStringClass" which was a descendant of
NSString, you could pass a value of class
MyAirportSpecializedStringClass, and everything would be peachy. This
is true because of the magic of inheritance.
Eg:
NSString * airportName ;
MyAirportSpecializedStringClass * airportNameToo ;
// allocate and initialize and set airportName and airportNameToo
[someObjectThatCaresAboutAirports setAirports:airportName];
[someOtherObjectThatCaresAboutAirportsToo setAirports:airportNameToo];
Hope this helps,
Russell Ahrens
Oink Industries
NOTICE: Class and Variable names made annoying on purpose. Do not look
directly at Class and Variable names without consulting your physician
first.
On Friday, June 22, 2001, at 04:22 PM, Finlay Dobbie wrote:
all obj-c objects are pointers, they are never statically allocated.
myArray is actually a pointer to an NSMutableArray. i'm surprised your
C book doesn't have more on pointers, they're a fundamental thing that
you need to understand, and are not terribly easy to grok in the
beginning.
-- Finlay
On Friday, June 22, 2001, at 07:06 pm, email@hidden wrote:
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:
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
References: | |
| >Re: *? (From: Finlay Dobbie <email@hidden>) |