Hi Fred,

> Most likely it isn’t working for the same reason as that code wasn’t working 
> on GNUstep :-)
> The runtime function will only check for methods defined by the protocol 
> directly not for inherited ones. That is why the GNUstep function has 
> „recursive“ in its name. It is checking in the ancestry of the protocol.


My test code was

@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));
   
Where is the ancestry here? Isn't "doIt" defined directly in this example?

Thanks,

 Andreas

_______________________________________________
Discuss-gnustep mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to