gnustep-dev
[Top][All Lists]
Advanced

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

Re: Issues subclassing NSMutableArray


From: mickbert
Subject: Re: Issues subclassing NSMutableArray
Date: Mon, 24 Feb 2020 12:08:19 +0100
User-agent: Posteo Webmail



On 24.02.2020 11:53, Wolfgang Lux wrote:

The trick here is that the alloc method in the NSMutableArray class
has a special case to allocate a GSMutableArray instance when called
on the NSMutableArray class, but not so for any subclass. So
[NSMutableArray alloc] returns a GSMutableArray instance, while
[MyMutableArray alloc] returns a MyMutableArray instance.


Now I understand better. I had a look to the sources, and what I found surprised me: in few places I found

    if (self == NSMutableArrayClass)

So it is specifically designed not to allow subclassing (which is meaningful, from some point of view).
Thanks for clarification.
--
Mick



reply via email to

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