On Tue, Mar 18, 2014 at 5:30 PM, William Squires <wsqui...@satx.rr.com>wrote:

> My best guess is to:
>
> 1) Make an ObjC class, and have it implement those methods that subclasses
> don't have to override. For those the subclasses must override, implement a
> stub that raises an exception if a message is sent to it (as ObjC doesn't
> have an "abstract" keyword).
>

This is about the best you're going to do in terms of being able to "force"
subclasses to override those methods.


> 2) Create a ObjC protocol with the same name as the above class, and
> copy/paste the method prototypes from the ObjC class' .h file into the
> protocol's .h file.
> 3) Go back to the ObjC class, and have it implement its own interface.
>

This doesn't really seem to buy you much. If the base class conforms to the
protocol, then any methods required by the protocol must be implemented by
that base class. The base class wouldn't have to implement optional
methods, but neither would the subclasses. The net impact on the subclasses
is pretty much nothing.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to