Launching a calculator app I'm making following along Lynda's "Programming for Non-Programmers" course. Literally launching the simulator for the first time, and I get this error message in my AppDelegate.swift code section:
Thread 1: Signal sigabrt
My debugger reads:
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
This is all greek to me. Any help is much appreciated!
This could be a few things. In your view controller, there should be three buttons on the top. Right click on the left one and it will show you a list of IBOutlet connections. Delete any that have an alert triangle next to them. If that doesn't solve your problem, try reading a little further up in your debugger to see if it says anything that gives more detail.
Related
I am building an app in Xcode 9 (Swift 4) and it crashes before it even loads completely. I get an error: Thread 1: Signal SIGABRT and libc++abi.dylib: terminating with uncaught exception of type NSException. How do I know which line of code is causing the error using breakpoints and debugging? Any help would be appreciated. Thanks!
(Here's a screenshot as well)
What you need here is an exception breakpoint. An exception breakpoint is a special kind of breakpoint that breaks whenever an exception occurs, instead of on a specific line in a specific file every time. The line where the breakpoint breaks is the line that throws the exception. To set an exception breakpoint, you'll need to open the breakpoint navigator and press the + button in the bottom left
A little menu will pop up, and from that, you select Exception Breakpoint…
A 3rd menu might pop up afterwards, but you can just click anywhere outside of it to dismiss it. After that, when you build and run your app again, it will break whenever an exception is thrown on the line that it is thrown
You gotta scroll up to see the error. If you scroll up above all the "terminating with uncaught exception of type NSException" stuff you will see something like "Terminating app due to blah blah blah" and then in the next line right below it will say "reason: blah blah blah". That should tell you why the app crashed.
I have a tableview and get the error
libc++abi.dylib: terminating with uncaught exception of type NSException
if I start scrolling the table. If I jump to other table position with help of the section indices on the right there is no problem. Only the scrolling causes the crash.
What is really weired is that I do not get any further infos. Non of the threads points to my code and I tried it with XCode 8 and XCode 8.1 beta 2.
Usually XCode tells me what the problem is. Also I made sure that all indices are in its bounds, etc.
Any idea how to debug this?
I am getting the following error on my app when it randomly crashes during testing.
The logs show the following:
Is there any way possible I can track why this error is apprearing? I'll be super grateful.
Best.
Go to the Breakpoint Navigator. Click the plus sign on the bottom left. Add exception breakpoint. It will break right before the weird error you are seeing :)
You know the pane on the left that shows your files? At the top of it there are 7 buttons or so, and one is shaped like a breakpoint. That's the navigator.
I sometimes get this error:
*** Terminating app due to uncaught exception 'NSGenericException', reason:
'*** Collection <__NSArrayM: 0x170057580> was mutated while being enumerated.'
I understand that I'm mutating an array while using fast enumeration, but I can't figure out how to identify where this issue is happening. The stack trace shows me absolutely nothing, and other than just randomly setting breakpoints and guessing until I find it, I can't figure out a good way to zero in on where this is happening.
Is there some kind of breakpoint magic I can do so the compiler shows me where this happens? Or can I use NSZombies to somehow identify this? Any help would be much appreciated.
See how to set an exception breakpoint:
https://developer.apple.com/library/ios/recipes/xcode_help-breakpoint_navigator/articles/adding_an_exception_breakpoint.html
But in the latest Xcode you only need to do these steps:
In the bottom-left corner of the breakpoints navigator, click the Add button.
Choose Add Exception Breakpoint.
You then get this in the breakpoint navigator
Your code will now break when the exception is thrown rather than when it is caught. You should be able to navigate the call stack to see where in your code the exception is occurring.
So I am getting a thread error Thread 1: Breakpoint 1.1 in my IBAction function. The code runs without error, but when I click the button on the simulator, the simulator crashes and produces the breakpoint error. The affected code is:
-(IBAction)ChangeView:(id)sender{
SecondView = [[SecondViewController alloc] initWithNibName:#"SecondViewController"
bundle:nil];
[self.view addSubview:SecondView.view];}
I have three other IBActions on the same class which work fine. I also defined in the h file as well.
-(IBAction)ChangeView:(id)sender;
I don't have much experience with thread errors and getting a bit frustrated trying to fix this problem. Any help is appreciated.
Thanks
Sounds like you have a breakpoint set on your function. Follow the instructions on this Stack Overflow question to remove the breakpoints.
I don't think your simulator is crashing, I think the execution is just pausing. You should be able to continue by hitting the play button or typing "c" in the console.