Re: Help on subclassing
Re: Help on subclassing
- Subject: Re: Help on subclassing
- From: Joachim <email@hidden>
- Date: Thu, 1 Dec 2005 19:56:53 -0800
Thank you, Sherm, this was exactly what I was looking for.
Joachim
On 1-Dec-05, at 11:19 AM, Sherm Pendley wrote:
You could declare the method in an "informal protocol" on class A:
@interface A : NSObject
{
}
@end
@interface A (PureVirtualMethods)
- (NSRect) someMethod;
@end
Now, you don't need to provide an implementation of -someMethod in
class A. But, you do need to re-declare the methods in the
interfaces for Classes B and C:
@interface B : A
{
}
@end
@interface B (PureVirtualMethods)
- (NSRect) someMethod;
@end
Naturally, you need to provide implementations for these methods in
B and C.
sherm--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
_______________________________________________
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