Re: Abstract classes and methods
Re: Abstract classes and methods
- Subject: Re: Abstract classes and methods
- From: Chris Gehlker <email@hidden>
- Date: Tue, 28 Aug 2001 21:47:15 -0700
On 8/29/01 8:54 PM, "stuartbryson" <email@hidden> wrote:
>
In C++ it is possible to force both classes and methods to be abstract.
>
That is classes that cannot be instantiated without being subclassed and
>
particular methods overrided. How do I force abstract classes and
>
methods in Obj-C.
AFAICT you can't. And you wouldn't want to if you could. Remember, pure
virtual classes occur at the top of inheritance trees to define the
interface to the tree. But in ObjC every class is a descendent of NSObject:
you never define the top of the tree. Even a class that functions as a pure
virtual class is going to have to define init as [super init] and dealloc as
[super dealloc].
Think Java, not C++, here.
--
When I was a boy I was told that anybody could become President. Now I'm
beginning to believe it. -Clarence Darrow, lawyer and author (1857-1938)