Re: Concrete Protocols
Re: Concrete Protocols
- Subject: Re: Concrete Protocols
- From: Philip Mötteli <email@hidden>
- Date: Wed, 31 Oct 2007 14:30:57 +0100
Am 31.10.2007 um 11:51 schrieb Chris Hanson:
On Oct 31, 2007, at 1:27 AM, Philip Mötteli wrote:
Has anybody found any documentation about concrete protocols? (That
was supposed to be one new feature in Objective-C 2.0.)
Protocols in Objective-C 2.0 can have methods that are marked as
@required and @optional for classes that conform to the protocol,
making them useful for describing delegate methods where protocols
weren't before.
Is this what you're referring to?
I'm referring to:
Concrete Protocols
Objective-C, just like Smalltalk, doesn’t have multiple inheritance.
This was a design decision, as it was with Java, because multiple
inheritance can cause headaches. Instead, Objective-C has categories,
which allow methods to be added to an existing class, and protocols
that specify interfaces.
Objective-C 2.0 adds the concept of a concrete protocol. Whereas a
protocol is a definition of an interface, a concrete protocol adds
some implementation detail as well. If the class that adopts the
protocol doesn’t provide its own implementation, it will get the
default implementation from the protocol.
These features can be combined effectively with @optional methods in a
protocol to provide a default implementation of @optional methods, but
allow an implementer to replace them with a more useful method.
_______________________________________________
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