• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Initialize a subclass object with a base class object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Initialize a subclass object with a base class object
      • From: "stephen joseph butler" <email@hidden>
References: 
 >Re: Initialize a subclass object with a base class object (From: Erik Buck <email@hidden>)

  • Prev by Date: Re: Custom NSPredicateEditorRowTemplate with Single Item
  • Next by Date: Re: KVO Response for incomplete paths
  • Previous by thread: Re: Initialize a subclass object with a base class object
  • Next by thread: Re: Initialize a subclass object with a base class object
  • Index(es):
    • Date
    • Thread