discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is +[NSMutableArray initialize] completely implemented?


From: Richard Frith-Macdonald
Subject: Re: Is +[NSMutableArray initialize] completely implemented?
Date: Sun, 22 Feb 2004 10:02:12 +0000


On 22 Feb 2004, at 09:30, Philip Mötteli wrote:

Am 22.02.2004 um 01:10 schrieb Richard Frith-Macdonald:
On 21 Feb 2004, at 23:49, Philip Mötteli wrote:

The runtime should ensure that [NSArray+initialize] is called before [NSMutableArray+initialize]

Is that sure?

Yes.

As I understood, the first time, a class receives a message, +initialize is called by the runtime. So if NSArray didn't receive a message before NSMutableArray receives its first message, it shouldn't be initialized.

NSMutableArray is a subclass of NSArray, so the runtime is required to send +initialize to NSArray *before* sending it to NSMutableArray. Check the NeXT or pple documentation.



and that [NSMutableArray+initialize] is called before any other method of the class, so I don't know how -initWithCapacity: could be called without NSMutableArrayClass being initialised.
or step through in debug yourself to find out what is going on?

I set a breakpoint in both +initialize, in NSMutableArray and NSArray and NSArray's initialize is clearly not called.

Then I guess for some reason the runtime does not think that NSMutableArray inherits from NSArray ... why not?

If you can produce a small testcase illustrating this behavior, I'll try to step through and debug it ... but perhaps you have a system dependent problem which would not show up on my system. You really need to build the runtime for debug and step through it to see why it's not calling the +initialise that it should.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]