• 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: protocol not seeing superclass implementation : bug or feature?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: protocol not seeing superclass implementation : bug or feature?


  • Subject: Re: protocol not seeing superclass implementation : bug or feature?
  • From: Marcel Weiher <email@hidden>
  • Date: Wed, 27 Mar 2002 13:36:26 +0100

Of course, this workaround also completely defeats protocols as a type-checking mechanism, because it lets you declare the class as conforming without actually implementing anything.

I think it was at this very point that I gave up on the whole protocol thing a couple of years ago.

Marcel

On Wednesday, March 27, 2002, at 12:28 PM, Nathan Day wrote:

Protocols don't work like this unfortunately but you can get a similar effect by implementing the formal protocol as part of an informal protocol, that is a category of the class with no implementation block.

for example

#import <AppKit/AppKit.h>

@protocol MyRectangle
- (NSRect)bounds;
@end

@interface TestView : NSView {
}
@end

@interface TestView (MyRectangle) <MyRectangle>
@ end

--
Marcel Weiher Metaobject Software Technologies
email@hidden www.metaobject.com
Metaprogramming for the Graphic Arts. HOM, IDEAs, MetaAd etc.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: protocol not seeing superclass implementation : bug or feature? (From: Nathan Day <email@hidden>)

  • Prev by Date: Re: Working with Audio
  • Next by Date: HELP MEEEEEEEE
  • Previous by thread: Re: protocol not seeing superclass implementation : bug or feature?
  • Next by thread: Re: protocol not seeing superclass implementation : bug or feature?
  • Index(es):
    • Date
    • Thread