Re: implement directly a protocol?
Re: implement directly a protocol?
- Subject: Re: implement directly a protocol?
- From: John Hörnkvist <email@hidden>
- Date: Sat, 10 Nov 2001 15:45:51 +0100
On Saturday, November 10, 2001, at 03:38 , email@hidden wrote:
Is it permitted to implement directly a protocol? The reason I ask is
that the compiler doesn't complain for:
@protocol A
@end
@implementation A
You're implementing the class A, not the protocol A. (@interface isn't
necessary for declaring a class.)
Unless there is an @interface A:X declaration somewhere, you're
implementing a root class.
The closest you can get to implementing a protocol is to use the
Concrete Protocol framework
(
http://www.toastedmarshmallow.com/Frameworks), or write categories on
the root class.
Regards,
John Hornkvist
--
ToastedMarshmallow, the perfect Cocoa companion
http://www.toastedmarshmallow.com