c++ try/catch ignorance in iOS -


in our app have c++ static library , use objective-c++ work it. c++ library utilizes rapidjson parse xml data:

try {             rapidjson::document document;             document.parse(connection.data.description);             connection.opentime = document["openfrom"].getint();             connection.closetime = document["opento"].getint();             return true;         } catch (std::exception e) {             connection.opentime = 0;             connection.closetime = 0;             return false;         } 

the problem if document["openfrom"] cannot converted int via getint() method, exception not raised. instead of app crashes sigabrt.

assertion failed: (data_.f.flags & kintflag), function getint, file /users/xxx/xxx/xx/ios/../src/rapidjson/document.h, line 1645. 

on android os, btw, in same case exception raised successfully. problem? guess issue in xcode's swift compiler behavior.

as stated in log provided – not crash, failed assert internally calls abort() results in sigabrt stands 'signal abort'. asserts disabled in release mode should work fine there. or can disable asserts in rapidjson (by defining macro rapidjson_assert).


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -