It looks like you have a script of your own called ctypes.py in a "temp" folder. Naming your scripts like built-in modules is never a good idea, try renaming it to something like ctypes_tests.py (and restart Pythonista if that doesn't help right away).
Ok, found a working solution in the MapView objc sample:
Need to use a dummy ui.Button and set the Python click handler function as its "action". Then can use the button as the target and sel("invokeAction:") as the action when defining the Objc accessory button.