[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Replacement for descriptionForInstanceMethod:
From: |
Fred Kiefer |
Subject: |
Re: Replacement for descriptionForInstanceMethod: |
Date: |
Tue, 8 May 2018 18:42:52 +0200 |
You should have a look at GSProtocolGetMethodDescriptionRecursive in
Additions/GSObjCRuntime.m. I think this should be able to provide the required
functionality.
Hope this helps,
Fred
> Am 08.05.2018 um 17:49 schrieb Andreas Höschler <ahoesch@smartsoft.de>:
>
> Hi all,
>
> I used to do stuff like so
>
> struct objc_method_description *methodDescription = NULL;
> methodDescription = [_protocol descriptionForInstanceMethod:aSelector];
> if (methodDescription == NULL) methodDescription = [_protocol
> descriptionForClassMethod:aSelector];
> if (methodDescription != NULL) types = methodDescription->types;
>
> using my ancient GNustep tree. This no longer works since [Protocol
> descriptionForInstanceMethod:] got deprecated and no longer available. I
> tried to replace this with (complete test code):
>
> @protocol TestProtocol
>
> - (void)doIt;
>
> @end
>
> Protocol * _protocol = @protocol(TestProtocol);
> SEL aSelector = @selector(doIt);
> struct objc_method_description _methodDescription =
> protocol_getMethodDescription(_protocol, aSelector, NO, YES);
> if (_methodDescription.name == NULL) _methodDescription =
> protocol_getMethodDescription(_protocol, aSelector, NO, NO);
> NSLog(@"_methodDescription.name %@",
> NSStringFromSelector(_methodDescription.name));
>
> but always get
>
> 2018-05-08 17:43:02.800 AppbaseClient[37957:168060] _methodDescription.name
> (null)
>
> What am I doing wrong?
>
> Thanks a lot,
>
> Andreas
>
>
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnustep