Re: Initialize a subclass object with a base class object
Re: Initialize a subclass object with a base class object
- Subject: Re: Initialize a subclass object with a base class object
- From: "stephen joseph butler" <email@hidden>
- Date: Mon, 19 May 2008 18:00:48 -0500
On Mon, May 19, 2008 at 5:52 PM, Erik Buck <email@hidden> wrote:
> I am not sure I understand the OP's question, but the shortest answer seems to be to override the super class's designated initializer.
I think he wants an Objective-C equivalent to a C++ copy constructor. That is...
ButtonCell *bCell = getFromSomewhere();
MyButtonCell *mCell = new MyButtonCell( &bCell );
... and have mCell be a copy of bCell, but with a new class type. I
don't think that Obj-C generally supports this in any of its patterns.
What I suspect he REALLY wants to do is go into IB and set a custom
class for his button cell. But that's just a guess.
_______________________________________________
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