RE: Abstract classes and methods
RE: Abstract classes and methods
- Subject: RE: Abstract classes and methods
- From: "Smith, Bradley" <email@hidden>
- Date: Wed, 29 Aug 2001 09:20:24 +0100
No such thing (in C++) as a pure virtual class. Only pure virtual functions
and these can occur anywhere in the class hierarchy. One pure virtual
function makes the whole class abstract. Parents on the abstract class need
not also be abstract however.
Stuart's question is still a valid one. Abstract classes are a useful
feature of C++. How would one go about achieving the same objective (excuse
the pun) in Objective-C?
Brad
>
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.