OK! It is work!
We should use on_main_thread
Like this:
replyblock = ObjCBlock(myblock, restype = None, argtypes = [c_void_p, c_bool, c_void_p])
on_main_thread(context.evaluatePolicy_localizedReason_reply_)(1, '爪纹识别', replyblock)
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.
OK! It is work!
We should use on_main_thread
Like this:
replyblock = ObjCBlock(myblock, restype = None, argtypes = [c_void_p, c_bool, c_void_p])
on_main_thread(context.evaluatePolicy_localizedReason_reply_)(1, '爪纹识别', replyblock)
OK! It is work!
We should use on_main_thread
Like this:
replyblock = ObjCBlock(myblock, restype = None, argtypes = [c_void_p, c_bool, c_void_p])
on_main_thread(context.evaluatePolicy_localizedReason_reply_)(1, '爪纹识别', replyblock)
Thank for you help me but it crash again
I think is context.evaluatePolicy_localizedReason_reply_() make it crash and ObjCBlock class has something wrong
I'm sorry but my English is poor
This is my code
from objc_util import *
from ctypes import *
import dialogs
def block(_cmd, succeed, error_ptr):
pass
context = ObjCClass('LAContext').alloc().init()
error = ObjCClass('NSError').alloc().init()
print(context.canEvaluatePolicy_error_(1, c_void_p(id(error))))
context.evaluatePolicy_localizedReason_reply_(1, 'Touch ID', ObjCBlock(block, restype = None, argtypes = [c_void_p, c_bool, c_void_p]))
I know we should using objective-c type 'BOOL' here but there are no "BOOL"
That make the app crash
Who can help me make it work