Re: method_exchangeImplementations problem
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com 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? -- Terry _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... On Sep 4, 2009, at 6:33 AM, Donnie Lee wrote: objc_getClass() is documented as returning the meta class instead of the class. I think you are possibly calling this on class 1 twice. If this doesn't turn out to be the case, you should provide a small code project as part of the bug report you file. This email sent to site_archiver@lists.apple.com
participants (1)
-
Terry Lambert