Re: Replacing a method via categorys
Re: Replacing a method via categorys
- Subject: Re: Replacing a method via categorys
- From: "M. Uli Kusterer" <email@hidden>
- Date: Tue, 28 Jun 2005 19:21:32 +0200
At 11:24 Uhr +0300 28.06.2005, Ofri Wolfus wrote:
You may want to read this - http://cocoadev.com/index.pl?MethodSwizzling
It explains exactly what you want.
Don't. Use poseAsClass instead. Method swizzling only works as
expected if the method to be swizzled actually exists in the class
you're working on. If it's a method that was inherited from a
superclass, you'll end up replacing the superclass's method -- ouch.
With poseAsClass, you effectively just subclass the class and tell
the rest of the app to use your subclass whenever it asks for the
superclass. So, to call the original method (whether inherited or
not), you can simply call super.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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