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

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

Reply via email to