objc.signature 记录在哪里?

Where is objc.signature documented?

我正在尝试为 NSWebView 实现一个委托,但是当我 运行 它时,我得到这个错误:

TypeError: Error when calling the metaclass bases
    class Delegate does not correctly implement protocol WebScripting: the signature for method isSelectorExcludedFromWebScript: is c@:: instead of Z@::

我在哪里可以找到 'c@::' 的文档,而不是 'Z@::',我的代码可能有什么问题?

问题方法如下:

def isSelectorExcludedFromWebScript_(self, sel):
    return True

具体来说,NSWebView 记录在:https://developer.apple.com/library/mac/documentation/Cocoa/Reference/WebKit/Classes/WebView_Class/index.html(但我怀疑 Apple 将来会移动这个 URL)

更准确地说,我尝试使用的代表的非正式协议记录在此处:https://developer.apple.com/library/mac/documentation/Cocoa/Reference/WebKit/Protocols/WebFrameLoadDelegate_Protocol/index.html#//apple_ref/doc/uid/TP40003828 and https://developer.apple.com/library/mac/documentation/Cocoa/Reference/WebKit/Protocols/WebScripting_Protocol/index.html#//apple_ref/doc/uid/TP40001562

我找到的 objc.signature 的唯一文档位于:http://pythonhosted.org/pyobjc/api/module-objc.html

标准 objective-c 类型编码记录在 Apple's ObjC runtime reference 中。这将 c 定义为 char,将 @ 定义为对象,并将 : 定义为选择器,但没有提及 Z.

PyObjc 添加了一些不在该列表中的内容,如 http://pythonhosted.org/pyobjc/api/module-objc.html#objective-c-type-strings by reference to a bunch of constants in the objc module. objc._C_NSBOOL has the value Z (also mentioned in the pyobjc BridgeSupport docs)

中所述

所以看起来问题与将 Python 的 True 转换为正确的 objective c 类型有关,但我不确定如何更正问题。