Re: Sensible way to extend base class?
Re: Sensible way to extend base class?
- Subject: Re: Sensible way to extend base class?
- From: Graham Cox <email@hidden>
- Date: Wed, 20 May 2009 22:35:06 +1000
On 20/05/2009, at 10:24 PM, Jerry Krinock wrote:
I believe a short version of your question is: "How can I get
multiple inheritance?" The short answer is that Objective-C does
not support multiple inheritance.
Yep. I know that, which is why I'm trying to find an elegant workaround.
Any solution I've missed?
Re-think your design so that the required ivars can be stored in a
delegate. If desired to make it more fool-programmer-proof and
reuseable, declare the delegate with an informal or formal protocol.
The problem there is that A doesn't have a delegate, and adding one
requires an ivar... back to square 1.
I'm trying to pretend I don't have access to the source for A, which
would be the case for a Cocoa class for example. Let's pretend that :)
Adding a 'delegate' ref would be just about acceptable, though it
would be unused entirely in the framework that provides the object.
--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