protocol_addMethodDescription problems

Hi,

I'm wondering if anyone else has seen this (and hopefully found a workaround). I'm working on a bug in PyObjC (https://github.com/ronaldoussoren/pyobjc/issues/17) related to protocols and can reproduce this in pure (Objective-)C.

PyObjC creates a protocol and populates the method descriptors using the Objective-C runtime API, e.g. objc_allocateProtocol and protocol_getMethodDescription.

This appears to work unreliably when adding multiple methods using protocol_getMethodDescription when the selector name and/or type encoding argument to protocol_getMethodDescription are not static strings: When the arguments are not static strings I have trouble finding the method descriptor using protocol_getMethodDescription.

The code fails intermittently when adding two methods (but still fairly often), and fails reliably for me when adding 3 methods.

The PyObjC issue I mentioned earlier contains a full reproducer.

From your GitHub issue I noticed you filed a bug, FB11984735. That’s still settling in our system. My advice right now is that you give it some time to settle, say a week, and then post back here and I’ll take another look.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

protocol_addMethodDescription problems
 
 
Q