This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Anyone using ObjCBlocks?
JonB last edited by
Has anyone been using ObjCBlocks that take multiple arguments in any APIs? I stumbled across what might be a pythonista bug, but it could easily just as well be my own stupidity.
I have started tackling AudioUnits to experiment with real time audio processing. To that end, I am using
and installing a data tap, which takes a Block of this form
typedef void (^AVAudioNodeTapBlock)( AVAudioPCMBuffer *buffer, AVAudioTime *when);
The Python function I tried to use was
def tap(_self, _sel, buffer, when)
however, the proper method seemed to be
def tap(_self, when, buffer, _sel)
In other words, the argument order was backwards, except for the block itself. does the runtime swap arguments on us? Or is pythonista objc_utils doing something funny?
dgelessus last edited by
Maybe this has something to do with iOS's 64-bit vararg calling conventions being different from normal 64-bit ARM. I think we were discussing that issue on Slack once, when @lukaskollmer tried to get
NSLogworking on a 64-bit device.
The only reason I can think of why the argument order is so strange is that maybe
_selfis "early" enough in the list that it's passed as a register, and the rest of the arguments go on the stack, but somehow are in the wrong order?