• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Initializing an Array
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Initializing an Array


  • Subject: Re: Initializing an Array
  • From: email@hidden
  • Date: Tue, 22 Jan 2002 13:45:55 -0800

Object-Oriented Programming and the Objective-C Language

file://localhost/Developer/Documentation/Cocoa/ObjectiveC/3CoreObjC/How_Messaging_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


  • Follow-Ups:
    • Re: Initializing an Array
      • From: Jeff Galyan <email@hidden>
References: 
 >Re: Initializing an Array (From: Jeff Galyan <email@hidden>)

  • Prev by Date: Re: Initializing an Array
  • Next by Date: Re: Initializing an Array
  • Previous by thread: Re: Initializing an Array
  • Next by thread: Re: Initializing an Array
  • Index(es):
    • Date
    • Thread