Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

App crashes on launch when exception breakpoint is active

Tags:

xcode

ios

I just started to continue development of a legacy iPad app that works and is in the store.

I noticed that the exception breakpoint in the project is not enabled. When I enable it, the app crashes on launch (device and simulator), but gives me no information in the output window, and only rather useless information in the thread view (see below)

I tried to fix it..

  • by setting Autolayout to off.
  • by editing and re-saving the storyboard file .. but so far no luck.

My guess is, that something is broken in the Storyboard, since the App Delegates "did finish with launching... "method doesn't get reached.

Is there a way to further track down the crash? Without having the exception breakpoint enabled, the app works. But I would love to use the exception breakpoint.

enter image description here

like image 947
brainray Avatar asked Dec 18 '14 12:12

brainray


2 Answers

I had the same issue with one of my project I am working on.When you set an Exception Break point, you'll be setting the breakpoint for all kind of exceptions ( Objective - C and C++ exceptions ). If you go and edit the Exception Breakpoint, and set it to "Objective-C" you might stop getting the exceptions you're getting. Here are the steps to do it.

  1. Right click on exception breakpoint. Right click on exception breakpoint.

  2. Select the dropdown Exception type and select Objective-C enter image description here

The exception which you are getting might be an C++ exception, for example NSURLSession gives C++ exception. Are you calling any service at the launch BTW. :) HTH :)

like image 65
iamyogish Avatar answered Oct 20 '22 04:10

iamyogish


Can you make a global project find for awakeFromNib and if it exists, put a breakpoint at the start of that delegate method. Then continue debugging until you pinpoint the error. Because that function gets called before application:didFinishLaunchingWithOptions: as you have guessed.

like image 2
aytunch Avatar answered Oct 20 '22 03:10

aytunch