I built and debugged my single file ui based app in Pythonista. It works as expected. Then I downloaded the xcode template and pasted my code into Script.py. I then ran it and eventually it built and loaded. I started walking through the various features and things worked for a while but one particular button press causes a crash. It failed with error: "unrecognized selector sent to class" The crash dump is below.
Before I start posting python and asking for detailed help with my code I wonder if someone can give my advice on how to start debugging an xcode based failure like this. The error message is basically incomprehensible to me. I am an experienced C++ programmer but still stumble in ObjectiveC but even so I am baffled by the complete lack of symbolic annotation of things like the call stack.
The failure seems to be in an action callback for a button I added to the the top bar left_button_list. The callback's job is to switch views which it does with a sequence of remove/add _subviews with an .end_editing() thrown in to get rid of a TextField keyboard. I was trying to follow a suggestion omz made in a forum thread somewhere about switching views. It all works fine in Pythonista. How do I debug an xcode specific failure? While waiting for advice I will do the normal print based debug and try to identify the specific line of python code that is failing. The visual evidence seems to narrow it down the the small number of lines in the action callback method and the implicit TableView load that happens so that shouldn't take long. After I get a night's rest. ;-)
Thanks
-steve (aka zencuke)
2014-10-30 03:35:14.283 PythonistaProject[523:61887] +[UIResponder om_firstResponder]: unrecognized selector sent to class 0x33448ea0
2014-10-30 03:35:14.286 PythonistaProject[523:61887] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[UIResponder om_firstResponder]: unrecognized selector sent to class 0x33448ea0'
*** First throw call stack:
(0x24d05c1f 0x324b0c8b 0x24d0af55 0x24d08f57 0x24c3adf8 0x37338b 0x28481197 0x28485bd1 0x24c2d2df 0x24c2d1db 0x282947b3 0x3648b9 0x38a6b9 0x28ecad 0x291181 0x28ea51 0x28bf47 0x228b0d 0x1fff6b 0x20b071 0x1fff6b 0x2909e5 0x377507 0x281f5c2b 0x283596fd 0x281f5c2b 0x281f5bd1 0x281e0863 0x281f563d 0x281f5317 0x281eebe1 0x281c53dd 0x28438c29 0x281c3e39 0x24ccc377 0x24ccb787 0x24cc9ded 0x24c18211 0x24c18023 0x2c0110a9 0x282241d1 0x59783 0x32a30aaf)
libc++abi.dylib: terminating with uncaught exception of type NSException