• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Help on subclassing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Re: Help on subclassing (From: Joachim <email@hidden>)
 >Re: Help on subclassing (From: Sherm Pendley <email@hidden>)

  • Prev by Date: Re: Is Apple's singleton sample code correct?
  • Next by Date: Re: Is Apple's singleton sample code correct?
  • Previous by thread: Re: Help on subclassing
  • Next by thread: Re: Help on subclassing
  • Index(es):
    • Date
    • Thread