Re: Calling original method implementation from category
Re: Calling original method implementation from category
- Subject: Re: Calling original method implementation from category
- From: Ondra Cada <email@hidden>
- Date: Mon, 25 Apr 2005 17:52:18 +0200
Georg,
On 25.4.2005, at 10:31, Georg Tuparev wrote:
I need to add a NSError category. The category implementation of
-domain needs to call the original NSError's -domain method. Here what
I am doing:
You can't do this an easy way. When a category gets loaded, its method
implementation *replaces* the original one, rendering it, from the
class structure point of view, effectively nonexistent.
Commonly, this is being solved with poseAsClassing, or (less common,
but sometimes needed too) replacing the IMP with another method's IMP
(I won't provide the code since it's exactly what Axel Anderson already
did).
Another possibility, if you don't want to mess with the runtime that
much, would be a two-stage bundle, which first stores the original IMP,
and only then loads the second-stage bundle with the category.
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
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