(null) libc++abi.dylib: terminate called throwing an exception
If you didn't change anything, this could just simply be related to the iOS 6 beta as it currently stands.
However, for those googling upon this error, here are some general suggestions:
1) It could be the simulator you've chosen to build the same code for :
If you haven't changed any source code, check to make sure your scheme is still pointing to the same simulator that it last worked on. (For example, trying to present a modal view controller (presentModalViewController:
), but forgetting to conditionally use a popover for iPad, could cause this.)
2) If the stack trace and console are unhelpful :
Sometimes, the only things in the stack are main
and UIApplicationMain
, which makes it difficult to trace what went wrong in your own source. This is likely a sign that something is failing in a native framework method that you're calling or causing to be called.
If no method or specific object is listed in the console and the stack trace does not point to any methods from your own classes, try to narrow down the execution as close as you can to the point at which the exception is thrown. When picking breakpoints in the dark, I tend to use a binary search approach, picking a pivot point and moving up and down the execution order and picking a new "halfway" point as necessary.
libc++abi.dylib: terminate_handler unexpectedly threw an exception - 0 stack trace iOS7 / iOS 8
Clean the project.
Check each constraints and remove the corrupted one.
Clean project again, it should works.
libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)
CMYR - "his could also happen if you've wired up a button to an IBAction that doesn't exist anymore (or has been renamed)"
If you're running into this problem make sure that you go to Main.storyboard, RIGHT click on the yellow box icon (view controller) at the top of the phone outline and DELETE the outlet(s) with yellow flags.
What happens in instances like this is you probably named an action, then renamed it. You need to delete the old name and if that was the only issue will start right up in sim!
index 0 beyond bounds for empty array' libc++abi.dylib: terminate called throwing an exception
OK an array can be empty, in which case the following statement will cause an exception:
NSDictionary *dictionary = [[placemarks objectAtIndex:0] addressDictionary];
// ^
So guard against it, with something like:
if ([placemarks count] > 0) {
NSDictionary *dictionary = [[placemarks objectAtIndex:0] addressDictionary];
....
}
I haven't read the API docs for that completion handler, but you can probably test if error
is non-nil
and act accordingly (i.e. if error != nil
respond to error, else process the placemarks
array).
libc++abi.dylib: terminate called throwing an exception Abort trap: 6
In the line:
if (Number.at(i) != Number.at(M-i+1))
when i = 1 you try to access Number.at(M)
which is out of the bounds of string M
while M
is the length of the string. Rather, it should be:
if (Number.at(i) != Number.at(M-i))
Core data crashe with libc++abi.dylib: terminating with uncaught exception of type NSException
It's impossible to be certain but your stack traces strongly suggest that the problem is related to updating your table view from NSFetchedResultsControllerDelegate
callbacks. From one of your comments, the likeliest cause is that you're not calling beginUpdates()
on the table view anywhere.
There are two basic approaches to updating a table view from NSFetchedResultsControllerDelegate
. First, simple but not optimal: Don't implement controllerWillChangeContent(_:)
or controller(_:didChange:at:for:newIndexPath:)
. Do implement controllerDidChangeContent(_:)
, but use that method to reloadData()
on your table view. Don't bother with begin/end updates or inserting/deleting/etc rows.
The second, better but slightly more complex, is to do all of these:
- Implement
controllerWillChangeContent(_:)
and use it to callbeginUpdates()
. - Implement
controller(_:didChange:at:for:newIndexPath:)
to insert/update/etc rows in the table. - Implement
controllerDidChangeContent(_:)
and use it to callendUpdates()
.
The "begin" and "end" calls are both crucial. I can't be 100% sure that this is what's causing your specific crash, but I'd expect leaving out beginUpdates()
to cause some kind of crash.
Objective-C stack trace
A couple of useful things:
If you're running your app out of Xcode, add an exception breakpoint. In the breakpoint navigator (command-6) hit the '+' at the very bottom left to add. This will pause execution on the line that throws the exception and allow you to inspect the current scope, stack, etc.
If you're using gdb, use
bt
to print the backtraceIf you're using lldb, use
thread backtrace
instead
Related Topics
How to Solve "Error Running Pod Install" in Flutter on MAC
Alternative Ways to Push View Controllers with Storyboard Programmatically
How to Add Headerview in Uicollectionview Like Uitableview's Tableheaderview
Change Order of Read Items with Voiceover
Cagradientlayer Diagonal Gradient
How to Change the Uisearchbar Search Text Color
How to Add Constraint Between a View and the Top Layout Guide in a Xib File
Uiscrollview's Origin Changes After Popping Back to the Uiviewcontroller
What's Dead & Exploded in Swift's Exception Stack
Facebook Share Content Only Shares Url in iOS 9
How to Cache Using Nsurlsession and Nsurlcache. Not Working
How to Adjust the Height of a Textview to His Content in Swift
Detect App Crashed During Load/Last Time It Was Run