• 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: Calling original method implementation from category
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calling original method implementation from category


  • Subject: Re: Calling original method implementation from category
  • From: Georg Tuparev <email@hidden>
  • Date: Mon, 25 Apr 2005 14:52:41 +0200


On Apr 25, 2005, at 2:12 PM, Axel Andersson wrote:

I think the problem here stems from you overriding -domain in a category, and then, later, assuming class_getInstanceMethod() will return the original -domain. It will, in fact, return your overridden method. You need to name your selector something else in order to be able to hold on to the old method. Here's some code I use for this, with your NSError category at the end:
[...]

I would like to use the same selector in my category. Otherwise there is no point running through all this pain and instead of the code you are suggesting I can just type:

- (NSString *)seDomain { return [self domain]; }

:-)


Georg Tuparev Tuparev Technologies Klipper 13 1186 VR Amstelveen The Netherlands Mobile: +31-6-55798196

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Calling original method implementation from category
      • From: Axel Andersson <email@hidden>
References: 
 >Calling original method implementation from category (From: Georg Tuparev <email@hidden>)
 >Re: Calling original method implementation from category (From: Axel Andersson <email@hidden>)

  • Prev by Date: Re: NSArchiver question
  • Next by Date: Re: Calling original method implementation from category
  • Previous by thread: Re: Calling original method implementation from category
  • Next by thread: Re: Calling original method implementation from category
  • Index(es):
    • Date
    • Thread