Forwarding, Method Signatures, Woe
Forwarding, Method Signatures, Woe
- Subject: Forwarding, Method Signatures, Woe
- From: Rob Rix <email@hidden>
- Date: Thu, 20 Feb 2003 22:32:29 -0500
Hello, all.
I'm trying to do some clever (that can be taken in both the good and
bad sense of the word) things with forwarding and method signatures.
Basically, I want -methodSignatureForSelector: on my proxy object to
get the method signature from its target object, and change it so that
its return type is id instead of whatever else it might be; everything
else should stay the same.
Some options I've found:
- subclassing NSMethodSignature. I tried this, and felt great... until
I found that it SIGBUSes and crashes. Damn. I'd assume it's because the
runtime isn't bothering to call the methods or something... anybody
know for sure if this should work?
- an undocumented method, +signatureWithObjCTypes: or some such on
NSMethodSignature which I found with otool and grep on Foundation; of
course, I don't _want_ to use undocumented methods.
- runtime hackery. This is looking likely unless I can figure out how
to get my NSMethodSignature subclass to work; the problem is, I don't
even know where to begin. It looks like I might have to add a method to
my proxy class, get its signature, and remove it... oi.
Anybody have any clever insights? Is it possible that my method
signature woes are just because of some retain/release problem in my
code, or do method signature subclasses really not work?
Is there a way to create a method signature from an IMP?
Thanks,
-- Robout
"America is the only country that went from barbarism to decadence
without civilization in between." -- Oscar Wilde
_______________________________________________
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.