ValueError: depythonifying 'pointer', got 'array.array'

Issue #237 new
Andy Tan
created an issue


I have an Objective C initializer initMyClass from MyClass that I’d like to use from Python with the following signature: - (instancetype)initMyClass:(SInt16 )dataArray descriptor:(MyDescriptor )descriptor;

However I get a “depythonifying ‘pointer’” error when I try to use it:

myclass = MyClass.alloc().initMyClass_descriptor_(array.array("l", [1,2,3]), my_descriptor) Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: depythonifying 'pointer', got 'array.array'

I check it’s signature and metadata() and all seems well:

MyClass.initMyClass_descriptor_.signature '@32@0:8^s16^{MTImageDescriptor=qdssIiiiSB}24'

MyClass.MyMethod_descriptor_.metadata() {'classmethod': False, 'hidden': False, 'retval': {'_template': True, 'type': '@'}, 'arguments': ({'_template': True, 'type': '@'}, {'_template': True, 'type': ':'}, {'null_accepted': True, 'type': '^s'}, {'null_accepted': True, 'type': '^{MTImageDescriptor=qdssIiiiSB}'})}

In any case I also tried running objc.loadBundleFunctions() but it couldn’t find my function:

objc.loadBundleFunctions(my_bundle, globals(), [("MyClass.initMyClass_descriptor_", "^l^@")], skip_undefined=False) Traceback (most recent call last): File "<stdin>", line 1, in <module> objc.error: cannot find a function

Any suggestions on how I should proceed? Thanks.

Comments (0)

  1. Log in to comment