Welcome!
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.
Problems when using objc_util()
-
@cvp
Usually the second run has an error,maybe it's after first completion...... -
@rozaimech, recommend trying
objc_util.retain_global
on the delegate. Classic fix for ”second run” issues. -
@rozaimech, I forgot that we need to retain the reference to the block. This seems reliable, and no progress needed:
def handler(_cmd, _object, _error): obj = ObjCInstance(_object) print(obj) handler_block = ObjCBlock( handler, restype=None, argtypes=[c_void_p, c_void_p, c_void_p]) retain_global(handler_block)
-
-
@mikael said:
I forgot that we need to retain the reference to the block.
I also knew it from a previous similar problem but I already forgot it, as usual 😢
-
@rozaimech We have also to thank @JonB for his help about threads.
I didn't know this calling wayon_main_thread(original_func)(args)
-
@cvp, yes. It applies to all descriptors, by definition.
Due to a bug, same way of calling using
on_main_thread
is currently needed forset_idle_timer_disabled
not to crash.