method_exchangeImplementations problem
method_exchangeImplementations problem
- Subject: method_exchangeImplementations problem
- From: Donnie Lee <email@hidden>
- Date: Fri, 4 Sep 2009 17:33:41 +0400
Hello!
I'd like to override delegate functions in Cocoa app. They are in
Class1 and Class2 (which is an instance of Class1). I get these
classes via objc_getClass(). Then I coded two functions and add them
to classes using class_addMethod(). Then I called
method_exchangeImplementations() for both of them.
Replaced delegate for Class1 works fine. But replaced delegate for
Class2 don't work. It starts working only for new instances of Class1
(and Class2 as Class1 instance variable), but don't work for original
instance. How to make it work?
PS: First I tried to use categories to override these delegates, but
for x86_64 linker don't link it as "lazy bound", even with "-undefined
dynamic_lookup" (i386 do it fine). Am I right that its impossible to
use categories anymore?
Thanks in advance,
Donnie.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden