Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 7: exception breakpoint firing in `main.m`, but app runs normally

I've set an "All Exceptions" exception breakpoint for my project. In Xcode 7, it mysteriously fires on launch in main.m, but there doesn't seem to be anything obviously wrong. On continuing, the app runs normally.

Even running the project in Xcode 6 now causes this breakpoint to fire.

screenshot of breakpoint

I can't figure out what is causing this. The threads don't indicate anything specific to what the cause is.

Maybe it's some sort of font issue in the Storyboard or something? Does anyone know a fix?

NOTE: It's a C++ exception, not Objective-C. Perhaps due to missing fonts. Xcode throws an exception in Main() in iOS 8 with 'all exceptions' breakpoint

like image 393
Ben Guild Avatar asked Jun 14 '15 08:06

Ben Guild


1 Answers

I have almost the identical problem in Xcode 7, as of beta 3. This workaround solved it for me.

Because it's a C++ exception, you can change your "All Exceptions" breakpoint to catch only Objective-C exceptions. Having done this, I no longer hit the mystery break on startup, and because I'm not writing C++, get 99% of the value of having the "All Exceptions" break point on.

Here's how:

  1. Go to the breakpoints tab (View > Navigators > Show Breakpoint Navigator or ⌘7).
  2. Right click on the All Exceptions breakpoint and "Edit Breakpoint..."

edit breakpoint

  1. Change the Exceptions covered to Objective-C only.

enter image description here

like image 180
Clay Bridges Avatar answered Oct 23 '22 11:10

Clay Bridges