Re: NSMethodSignature - how?
Re: NSMethodSignature - how?
- Subject: Re: NSMethodSignature - how?
- From: Jonathan Wight <email@hidden>
- Date: Sat, 13 Apr 2002 14:53:17 -0500
Seek and ye shall find.
Turns out I can use a hidden method in NSMethodSignature and some stuff from
<objc/Protocol.h> to do what I want. Here's my code now (hope the indenting
aint too awful):
- (NSMethodSignature *)methodSignatureForSelector:(SEL)inSelector
{
NSStringFromSelector(inSelector));
/* Let's see if our super class has a signature for this selector. */
NSMethodSignature *theMethodSignature
= [super methodSignatureForSelector:inSelector];
if (theMethodSignature == NULL)
{
struct objc_method_description *theDescription
= [mProtocol descriptionForInstanceMethod:inSelector];
theMethodSignature
= [NSMethodSignature signatureWithObjCTypes:theDescription->types];
}
return(theMethodSignature);
}
Thanks!
Jon.
On 04/13/2002 14:34, "Jonathan Wight" <email@hidden> wrote:
>
I'm writing what is basically a proxy to another object and I need to
>
override the object's methodSignatureForSelector method. Unfortunately I
>
can't get the method signature because the method doesn't actually exist -
>
I'll be extracting data from the NSInvocation to generate the function call.
>
Is there someway I can get a NSMethodSignature from a protocol (much like
>
I'd imagine NSRemoteProxy might do it)...
>
>
Jon.
>
_______________________________________________
>
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.
_______________________________________________
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.