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

Re: Categories overriding methods


  • Subject: Re: Categories overriding methods
  • From: Ondra Cada <email@hidden>
  • Date: Fri, 2 Aug 2002 17:20:48 +0200

On Friday, August 2, 2002, at 06:06 , David Newberry wrote:

I am thinking about using a category to over-ride a class's init: method to return a subclass of that class. (Make sense? :) My question is basically, is that OK?

In case you wanna trash the original init altogehter (never to be called in any condition), then it's all right.

Is this... reasonable code? The reason I want to do this is because I want code that's already wired to create instances of MyClass to instead create instances of MySubclass without fiddling with the existing code.

In this case -- and presuming there is no older code which depends on the original init -- it would work (most probably ;)). It is slightly strange though; would you not rather want to poseAsClass: the subclass entirely?
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: 
 >Categories overriding methods (From: David Newberry <email@hidden>)

  • Prev by Date: Re: define class variable
  • Next by Date: Re: Accessor methods and (auto)release <Memory trail>
  • Previous by thread: Re: Categories overriding methods
  • Next by thread: Project Builder bug (more specific)
  • Index(es):
    • Date
    • Thread