• 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: Subclassing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Subclassing


  • Subject: Re: Subclassing
  • From: j o a r <email@hidden>
  • Date: Fri, 18 Apr 2008 16:02:00 -0700


On Apr 18, 2008, at 2:56 PM, K. Darcy Otto wrote:

The only reason to subclass Deduction (with SDeduction) and then DeductionLine (with SDeductionLine) is to get an SDependency object. Is there an easier way? I suppose I could just copy the Dependency class files and then modify it for this particular project; but I was hoping for a different way. Thanks.



I think that what you would typically do is either to add:

	"-[DeductionLine initWithDependency:]"

// Where Deduction line doesn't know, or care about, what particular
// type of object is being passed, as long as it is either a subclass of
// Dependency, or it conforms to a specific protocol.


Or something like:

	"-[DeductionLine initWithProperty:]"

// Where the caller doesn't know about different Dependency classes,
// and instead specify some type of configuration / context property, to
// which the DeductionLine responds by instantiating an appropriate
// Dependency subclass.



j o a r


_______________________________________________

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


References: 
 >Subclassing (From: "K. Darcy Otto" <email@hidden>)

  • Prev by Date: Re: NSTableView -editColumn:row:withEvent:select: question
  • Next by Date: Re: Capsule-Style Toolbar Controls
  • Previous by thread: Subclassing
  • Next by thread: Re: Subclassing
  • Index(es):
    • Date
    • Thread