Re: Abstract classes and methods
Re: Abstract classes and methods
- Subject: Re: Abstract classes and methods
- From: Ondra Cada <email@hidden>
- Date: Wed, 29 Aug 2001 16:29:29 +0200
Karl,
>
>>>>> Karl Goiser (KG) wrote at Wed, 29 Aug 2001 23:53:02 +1000:
KG> The question, then, should be (as you were saying) "How do I stop
KG> anybody from instantiating a particular class?"
Actually, the question is "why would I want that"?
KG> And the answer to this would be to override 'alloc' or something like
init, rather. See class clusters for an excellent example of that technique:
you never ever see a, say, NSString instance.
KG> that and put an error message in it...
Well, it's not _that_ easy, since a subclass would quite probably want to
inherit +alloc and call [super init].
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc