libc++abi.dylib: terminate_handler unexpectedly threw an exception - 0 stack trace iOS7 / iOS 8

两盒软妹~` 提交于 2019-11-28 20:53:31

Clean the project. Check each constraints and remove the corrupted one. Clean project again, it should works.

Sean Dev

I got the same error and a "clean" didn't resolve it.

It was caused by my internet testing flow, I check to see if WiFi is connected but not if that WiFi has an active internet connection that can resolve a supplied URL. It performs a dataWithContentsOfURL: that will ultimately fail. A similar thread made this suggestion to this question here by user Keith that helped me identify the problem -- which was to add breakpoints to C++ exceptions.

To enable -- click your breakpoints view and the very bottom click the '+' to add a breakpoint. Set it up as follows and the stack trance will be more meaningful.

This can be caused by an outlet that is no longer existing (might have been renamed or removed).

Here is a tip on how to check outlets: Select the container view of the suspected outlet, pay attention to "!" marks in the connections inspector.

I got this question ,because I set [self addObserver:self forKeyPath:@"_defaultAgType" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:nil];, but I did not remove it in dealloc. I solved this by [self removeObserver:self forKeyPath:@"_defaultAgType"]; in dealloc function.

Another reason why it could happen is when you have a UI element declared but never added to the screen but still you try to do changes on them.

In my case I had a UIBarButtonItem declared in the code but I never added it to View. When I try to remove it without adding it, I had this issue.

If you renamed/moved your view controller class, make sure you've checked Inherit Module From Target on Identity inspector for your scene on the storyboard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!