Re: What is the equivalent of a C++ pure-virtual function in Objective-C?
Re: What is the equivalent of a C++ pure-virtual function in Objective-C?
- Subject: Re: What is the equivalent of a C++ pure-virtual function in Objective-C?
- From: Graham Cox <email@hidden>
- Date: Mon, 12 Jan 2009 13:29:35 +1100
On 12 Jan 2009, at 1:20 pm, Michael A. Crawford wrote:
I want to force derived classes to implement a given interface
without provided a default implementation. Does the concept exist
in Objective-C (I'm almost sure it does)? If so, what does the
syntax look like?
The nearest thing to pure virtual methods is a formal protocol,
declared using the @protocol directive.
file:///Developer/Documentation/DocSets/com.apple.ADC_Reference_Library.CoreReference.docset/Contents/Resources/Documents/documentation/Cocoa/Conceptual/ObjectiveC/Articles/chapter_7_section_6.html
A class that "conforms to" the formal protocol is required to
implement the methods of the protocol.
--Graham
_______________________________________________
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