Re: Abstract base classes in Objective C
Re: Abstract base classes in Objective C
- Subject: Re: Abstract base classes in Objective C
- From: Chaz McGarvey <email@hidden>
- Date: Thu, 14 Apr 2005 07:30:34 -0600
On Apr 14, 2005, at 6:18 AM, Ondra Cada wrote:
What I do, and I can't say that this is the norm, is to raise an
exception when I define what I would want to be a purely abstract
method that subclasses must override. Since Objective-C has no such
thing as pure virtual (using C++ lingo) methods, then this, as far as
I
can tell, is a good solution.
Quite.
And in a sense, it *is* a perfect norm and *the* way of doing that,
only instead the exception use the message which is standard exactly
for this:
-(void)publicMethod { // "abstract" method
[self doesNotRecognizeSelector:_cmd];
}
Nice. I usually raise an exception under this circumstance as well
(not really knowing what was the norm either), but I didn't realize
there was a standard method that would take care of it. Thanks!
Chaz McGarvey
http://www.brokenzipper.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden