gnustep-dev
[Top][All Lists]
Advanced

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

Re: Issues subclassing NSMutableArray


From: Riccardo Mottola
Subject: Re: Issues subclassing NSMutableArray
Date: Sun, 17 Nov 2019 19:16:16 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

Hi Richard,

On 11/17/19 4:53 PM, Richard Frith-Macdonald wrote:
Because NSMutable array is an abstract class.  You need to create a concrete 
class with actual instance variables to store data in.
In your case you overrode the superclass implementation, but did do by calling 
the superclass implementation ... which is abstract and can't do anything.  You 
have to override the implementation in a way that actually adds the object to a 
storage area.


Than you for the tip. I also had to override "init" in the same fashion you suggested. In layman terms, if you subclass something abstract, there is actually nothing, so there is no storage and you have to "wrap" it yourself and instead of using "super" use the content.


Riccardo




reply via email to

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