Re: Creating Interface
Re: Creating Interface
- Subject: Re: Creating Interface
- From: "Sherm Pendley" <email@hidden>
- Date: Thu, 28 Aug 2008 10:15:25 -0400
On Thu, Aug 28, 2008 at 9:56 AM, Roland King <email@hidden> wrote:
> I tried that before, making my protocol inherit from the NSObject Protocol
> and it sort of worked, but not quite.
Protocols aren't inherited. You can inherit an implementation of the
NSObject protocol, by writing a subclass of the NSObject class, but that's a
very different animal.
I don't quite understand why protocols like NSKeyValueObserving aren't
> formalized and in a .h file somewhere so you could just use them in the same
> way you can the NSObject protocol. They're documented, why not just write
> the .h file. There's probably a very good reason for it which has totally
> escaped me.
Conforming to a protocol is an all-or-nothing affair - you have to implement
*all* of the protocol's methods. The informal protocols I'm aware of tend to
have one or more optional methods.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden