Re: Initializing an Array
Re: Initializing an Array
- Subject: Re: Initializing an Array
- From: Jeff Galyan <email@hidden>
- Date: Tue, 22 Jan 2002 15:04:42 -0700
The version I have says "[[super alloc] init]"
--Jeff
On 1/22/02 2:45 PM, "email@hidden" <email@hidden> wrote:
>
Object-Oriented Programming and the Objective-C Language
>
>
file://localhost/Developer/Documentation/Cocoa/ObjectiveC/3CoreObjC/How_Messag
>
ing_Works.
>
html
>
>
For some tasks, each class in the inheritance hierarchy can implement a
>
method that does part of the job and pass the message on to super for
>
the rest. The init method, which initializes a newly allocated instance,
>
is designed to work like this. Each init method has responsibility for
>
initializing the instance variables defined in its class. But before
>
doing so, it sends an init message to super to have the classes it
>
inherits from initialize their instance variables. Each version of init
>
follows this same procedure, so classes initialize their instance
>
variables in the order of inheritance:
>
>
>
- (id)init
>
{
>
[super init];
>
. . .
>
}
>
>
>
On Tuesday, January 22, 2002, at 01:30 PM, Jeff Galyan wrote:
>
>
> Interesting... That means Apple's docs are wrong (or at least the
>
> version I
>
> have is -- "Inside Cocoa: Object-Oriented Programming and the
>
> Objective-C
>
> Language").
>
>
>
> Anyway, the way I fixed the crash was to remove the instance vars and
>
> the
>
> -initWithString: method and make the caller pass in a pointer to
>
> NSString
>
> with each message.
>
>
>
> --Jeff
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.