discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Replacement for descriptionForInstanceMethod:


From: Andreas Höschler
Subject: Replacement for descriptionForInstanceMethod:
Date: Tue, 8 May 2018 17:49:08 +0200

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]