您的位置:首页 > 编程语言 > C语言/C++

libc++abi.dylib handler threw exception

2016-09-09 14:09 357 查看
在iOS开发时,有时候遇到libc++abi.dylib handler threw exception这样的异常,  虽然在断点出加上了All Exceptions,也断到相应的代码了,但是没打印对应的日志,实际上不是这段代码的问题。因此不知道什么地方出错了。这时候可以用下面的代码来打印异常log

[cpp] view
plain copy

@try{  

   

    }  

    @catch(NSException *exception) {  

        NSLog(@"exception:%@", exception);  

    }  

    @finally {  

          

    }  

我在项目中使用了一下,打印出这样的日志来。

[html] view
plain copy

Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES  



因为子类需要横屏,父类没设置横屏,所以爆出异常来。这样修改相应的代码就解决了。

原文:http://blog.csdn.net/totogo2010/article/details/9816975
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息