Re: Calling original functions from overriding Category functions
Re: Calling original functions from overriding Category functions
- Subject: Re: Calling original functions from overriding Category functions
- From: Eric Forget <email@hidden>
- Date: Thu, 18 Mar 2004 13:03:31 -0500
>
When you subclass a class and override one of the superclass's
>
functions, you can still call the function with [super myMessage].
>
However, when you use a Category and override one of the functions in
>
the Category class, is there any way to call the original function?
I've never tried for myself, but there may be way, by using Objective-C
low-level runtime functions like:
Method class_getInstanceMethod(Class aClass, SEL aSelector);
void class_removeMethods(Class aClass, struct objc_method_list* methodList);
void class_addMethods(Class aClass, struct objc_method_list* methodList);
Look for "Objective-C Runtime Functions and Data Structures" in
<file:///Developer/Documentation/Cocoa/Conceptual/ObjectiveC/index.html>.
Eric
___________________________________________________________________
Eric Forget Cafederic
email@hidden <
http://www.cafederic.com/>
Fingerprint <86D5 38F5 E1FD 5D9C 71C3 BAA3 797E 70A4 6210 C684>
_______________________________________________
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.