Swift: Terminating with Uncaught Exception of Type Nsexception

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!

Sample Image

Is there any difference between type? and Nullabletype?

If you look at the IL using Ildasm, you'll find that they both compile down to Nullable<bool>.

libc++abi.dylib segue error with uncaught exception of type NSException

  1. Maybe you need to add UINavigationViewController like Initial View Controller?

Sample Image

Or you need override this method and setup some required data on second controller?

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if (segue.identifier == "home_to_quiz") {
let dectinationView = segue.destination as! YourCustomViewController
dectinationView.dataContainer = self.dataContainer
}
}

Addition


  1. Here are a few moments where something could go wrong:

    • Class of your UIViewController must be Inherit From Target

Sample Image

  • Try to delete your Selector (home_to_quiz:) in Storyboard. Do you implement a selector method inside a controller?

App crashing libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

Earlier, I have faced the same issue. Fix it by below solutions.

Solution:1

Please make sure FIRApp.configure() the statement executes once
throughout the project. If you have written more then one time then
you have to remove your second unused statement. It will solve your
problem.

Solution:2

1 ) Remove pod file from project (How to remove pod file)

2 ) Remove Old GoogleService-Info file from the project.

3 ) Download GoogleService-Info and add it into the project.

4 ) Add pods file Again.

5) Put the Below method in Appdelegate file.

override init() {
super.init()
FIRApp.configure()
}

terminating with uncaught exception of type NSException (lldb)

The problem is the two outlets PhotoSelect and PhotoSend. You probably accidentally created these as @IBOutlet, deleted them and recreated them as @IBAction.

See how they have a ! next to them. This means that these outlets are no longer connected. So when you run you app, your storyboard cannot find those outlets in your view controller, so it crashes.

You need to remove those outlets by clicking the x.

Terminating With Uncaught Exception Of Type NSException Timer Swift Crash

You are passing the wrong target to the timer. You want to pass clickClass, not self. And the selector should not reference the variable, it should reference the class.

timer = Timer.scheduledTimer(timeInterval: 1, target: clickClass, selector: #selector(playSound.repeatSound), userInfo: nil, repeats: true)

You should also take care to name things properly. Class, struct, and enum names should start with uppercase letters. Variable, function, and case names should start with lowercase letters.

terminating with uncaught exception of type NSException with swift

The issue is that you have an NSUnknownKeyException for the key 'empires'. This is usually caused by an outlet in the Storyboard that doesn't match the name in code. You most likely created an outlet when the variable was called empires before you re-named it to empires1.

To fix this, disconnect and re-connect the outlet in the storyboard.

FBLogin libc++abi.dylib: terminating with uncaught exception of type NSException

I missed to add APP_ID in the following config in info.plist After adding app_ID, the app connected to FB.

<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb{APP_ID}</string>
</array>
</dict>
</array>

terminating with uncaught exception of type NSException in Swift 5

Maybe something like this

var islem: String = screenTextfield.text!

if let number = Int(String(islem.last!)) {
print(number)
}
else {
islem.removeLast()
}

let exp = NSExpression(format: islem)
if let result = exp.expressionValue(with: nil, context: nil) as? NSNumber {
islemLabel.text = String(result.doubleValue)
}
else {
makeAlert(title: "Error", message: "Wrong math type")
}


Related Topics



Leave a reply



Submit