LibC ++ abi.dylib: termination with an uncaught exception of type NSException (lldb)

I program the application in quick mode, and when I run the test application on the iPhone simulator, everything works, but then I try to scroll to the right, which is the gesture I added for it to go to the next page (Controller Two view) it crashes and displays this error report in the console log.

2014-10-18 12:07:34.400 soundtest[17081:818922] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<soundtest.ViewControllerTwo 0x7f92f1f20090> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key sfdfa.' *** First throw call stack: ( 0 CoreFoundation 0x00000001067813f5 __exceptionPreprocess + 165 1 libobjc.A.dylib 0x00000001082afbb7 objc_exception_throw + 45 2 CoreFoundation 0x0000000106781039 -[NSException raise] + 9 3 Foundation 0x0000000106b984d3 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259 4 CoreFoundation 0x00000001066cb400 -[NSArray makeObjectsPerformSelector:] + 224 5 UIKit 0x00000001072ce97d -[UINib instantiateWithOwner:options:] + 1506 6 UIKit 0x000000010712f698 -[UIViewController _loadViewFromNibNamed:bundle:] + 242 7 UIKit 0x000000010712fc88 -[UIViewController loadView] + 109 8 UIKit 0x000000010712fef9 -[UIViewController loadViewIfRequired] + 75 9 UIKit 0x000000010713038e -[UIViewController view] + 27 10 UIKit 0x00000001076cd83f -[_UIFullscreenPresentationController _setPresentedViewController:] + 65 11 UIKit 0x000000010710bc49 -[UIPresentationController initWithPresentedViewController:presentingViewController:] + 105 12 UIKit 0x000000010713c121 -[UIViewController _presentViewController:withAnimationController:completion:] + 1746 13 UIKit 0x000000010713e461 __62-[UIViewController presentViewController:animated:completion:]_block_invoke + 132 14 UIKit 0x000000010713e385 -[UIViewController presentViewController:animated:completion:] + 229 15 UIKit 0x00000001073bb9d6 _UIGestureRecognizerSendActions + 262 16 UIKit 0x00000001073ba679 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 532 17 UIKit 0x00000001073bf296 ___UIGestureRecognizerUpdate_block_invoke662 + 51 18 UIKit 0x00000001073bf192 _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 254 19 UIKit 0x00000001073b520d _UIGestureRecognizerUpdate + 2796 20 UIKit 0x00000001070520a6 -[UIWindow _sendGesturesForEvent:] + 1041 21 UIKit 0x0000000107052cd3 -[UIWindow sendEvent:] + 667 22 UIKit 0x000000010701fae1 -[UIApplication sendEvent:] + 246 23 UIKit 0x000000010702cbad _UIApplicationHandleEventFromQueueEvent + 17370 24 UIKit 0x0000000107008233 _UIApplicationHandleEventQueue + 1961 25 CoreFoundation 0x00000001066b6ad1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 26 CoreFoundation 0x00000001066ac99d __CFRunLoopDoSources0 + 269 27 CoreFoundation 0x00000001066abfd4 __CFRunLoopRun + 868 28 CoreFoundation 0x00000001066aba06 CFRunLoopRunSpecific + 470 29 GraphicsServices 0x000000010a1699f0 GSEventRunModal + 161 30 UIKit 0x000000010700b550 UIApplicationMain + 1282 31 soundtest 0x000000010624503e top_level_code + 78 32 soundtest 0x000000010624507a main + 42 33 libdyld.dylib 0x000000010ae4a145 start + 1 34 ??? 0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb) 
+155
ios swift
Oct 18 '14 at 17:11
source share
32 answers
  • one
  • 2

CMYR - "it can also happen if you connect a button to an IBAction that no longer exists (or has been renamed)"

If you encounter this problem, make sure that you go to Main.storyboard, RIGHT click on the yellow window icon (view controller) at the top of the phone outline and REMOVE the outlets with yellow icons.

What happens in such cases, you are probably called an action, and then rename it. You need to delete the old name, and if this is the only problem, it will start right in the sim!

enter image description here

+358
Dec 09 '14 at 9:59
source share

Have you accidentally set the variable OS_ACTIVITY_MODE? To check if you have this variable set (and whether it is disabled), in Xcode 9 do the following:

Select from Xcode menu Product β†’ Scheme β†’ Edit Scheme.. Select the Run scheme and look under Arguments. If you see the OS_ACTIVITY_MODE variable checked, deselect it

+52
Jun 16 '18 at 15:12
source share

In Xcode 9 and Swift 4:

Print an exception stack to find out the reason for the exception:

  1. Go to showing the breakpoint of the navigator.
  2. Add (+) Add an exceptional breakpoint.

  3. Select a new breakpoint, Control-Click, Change Breakpoint.

  4. Add action and enter: po $ arg1

enter image description here

+41
Sep 02 '18 at 17:55
source share

Other solutions did not work with me, here is mine. This only applies to Xcode 8 when running in the old Swift 2.3 mode:

It looks like Interface Builder is trying to rename the method that should be connected to the button.

Here's a radar with more details.

The solution (workaround) is to manually replace the method parameter name with _ :

 @IBAction func editPictureTapped(sender: UIButton) { // not working print("Tapped") } 

Change to this:

 @IBAction func editPictureTapped(_: UIButton) { // working OK print("Tapped") } 
+7
Sep 17 '16 at 15:06
source share

In my case, I called the delegate method, but the method was not declared.

This error is common and may appear for a number of reasons. Make sure you don't turn off your logs to see what really happened. Turn on OS_ACTIVITY_MODE in the schemas if you disabled it. You could disable it to prevent a lot of unnecessary magazines, but they are convenient.

You can also track the cause in more detail by adding an exception breakpoint po $arg1 . As mentioned by Ahmed-Lotfi

Here is a general checklist that you can go through.

 2) Check if you have renamed an IBOutlet and calling it 3) Check if you have renamed a method name or the method doesn't exist 4) Check if you are trying to add or remove any view from hierarchy 5) Check for any missing framework or library 6) Check for any missing flag in the Proejct Setting (-obj) or any other linker flag etc. 
+5
Feb 06 '19 at 7:31
source share

It may also be the wrong Segue identifier name. For example -

 performSegueWithIdentifier("wrongSegueName", sender: self) 
+4
May 18 '15 at 3:15
source share

It started for me on Xcode 7, and I didn't have any dots with yellow flags that I could remove.

The only thing that worked for me was replacing this line in AppDelegate:

 [window addSubview:viewController.view]; 

at

 [window setRootViewController:viewController]; 
+3
Oct 16 '15 at 16:03
source share

For me, the problem was in my IBAction with UIButton.

When you Ctrl + Drag to create an IBAction from a UIButton, be sure to select "UIButton" from the "Type" drop-down list. The default selection of AnyObject crashes the application when clicking on UIButton.

enter image description here

+3
Jul 12 '16 at 22:43
source share

My situation was a little different, I tried to switch to the UINavigationController , and what was fixed for me received the main part of the queue.

For Objective-C:

 dispatch_async(dispatch_get_main_queue(), ^{ [self performSegueWithIdentifier:@"SegueName" sender:self]; }); 

For Swift 3:

 DispatchQueue.main.async { [weak self] in self?.performSegue(withIdentifier: "SegueName", sender: self) } 
+3
Nov 14 '16 at 16:04
source share

It can also be broken trigger segments, check the storyboard, as soon as you plug the segments or outlet back in, everything should work again.

Check the segues

Make sure the Identifier Segue is correct and similar to your code .

enter image description here

+2
Jan 21 '18 at 4:32
source share

I am new to Xcode, so it took me a few hours to figure out the problem in order to download the xls file. I followed through most of the code samples there, and none of them resolved the Xcode error shown.

I found that we need to specify β€œAdd to Target”: mark the project to add when we import the xls file into Xcode by dragging it to Project β†’ Supporting Files.

+1
Jul 28 '15 at 11:41
source share

I ran into this problem when I changed the name of a variable associated with one of my buttons. So keep that in mind!

+1
Aug 10 '15 at 19:40
source share

there may be more than 1 IBAction for a button in your view controller, try to figure them out and delete all previous elements for that button in the controller and create a new button. This will solve your problem.

+1
Apr 27 '16 at 9:42 on
source share

Make sure that you do not dynamically apply relative constraints to a view that does not already exist in the view hierarchy.

 UIView *bottomView = [[UIView alloc] initWithFrame:CGRectZero]; [self.view addSubview:bottomView]; bottomConstraint = [NSLayoutConstraint constraintWithItem:bottomView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeBottom multiplier:1 constant:0]; bottomConstraint.active = YES; 

In the above example, bottomView was part of the view hierarchy before applying relative restrictions to it.

+1
Jul 05 '16 at 4:38
source share

I have this error in the following two ways:

I was getting this error when I entered another UIViewController.

BECAUSE I was wrong, I subclassed another class from UITabBarController and got this error.

As I understand? I have been subclassed from UIViewController and I no longer crash :)




I did not want to use the storyboard. So I deleted it. However, I forgot to remove its link in the project settings. I just clicked on the project -> General -> Deployment Information -> and then I set the Main Interface to black space. (Previously, it was installed in the main position)

As you can see, in both situations you get an error to access some object that exists ...

+1
Oct 22 '16 at 0:55
source share

I am going to add my problem to the list of possible solutions in case someone else happens in this thread.

TableView cell identifier. First of all, make sure your cell has an identifier. Secondly, make sure you refer to this identifier when you deactivate the cell.

+1
Jul 26 '17 at 2:53 on
source share

Swift 4 :

I was getting this error due to a change in the UIVisualEffectView api. In Swift 3, this was fine: myVisuallEffectView.addSubview(someSubview)

But in Swift 4 I had to change it to this: myVisualEffectView.contentView.addSubview(someSubview)

+1
Nov 09 '17 at 16:59
source share

I had the same error when I had a typo for one of the views when building constraints using a visual formatter. I hope this helps someone ... or me once again.

+1
Feb 13 '18 at 17:37
source share

It may also be useful to create an exception breakpoint in Debug-> Breakpoints. Then we hope that the debugger stops at the line of code where the problem is located.

+1
May 14 '18 at 14:12
source share

If you use responsive to native and reactive own fire bases, make sure you link the Google-Services.plist file ( https://github.com/invertase/react-native-firebase/issues/313#issuecomment-320435560 )

+1
Dec 31 '19 at 17:11
source share

For Swift 2.3

This seems to be a bug with Xcode 8 and Swift 2.3, if you connect the button action to your code through the storyboard, make sure Xcode has not renamed the action, for me this is adding withSender: at the end of the methods, so I do this for my code and renaming method according to the one written by Xcode.

For any other version, check the correct answer.

0
Oct 17 '16 at 10:03
source share

In my case of Xcode 8.2.1 , I had a View Kit view in the view controller. So I went to

Assembly Phases> Link to Binary Libraries

and added MapKit.framework , then that was good.

I think this applies to other views that require a framework.

PS Launching on iOS 9 told me that there was a problem with Map Kit View, while on iOS 10 they didn’t tell me anything!

0
Feb 16 '17 at 3:49 on
source share

For me, only the drop armageddon solution worked:

  • remove application from device
  • clean project
  • start a new installation on the device
0
Mar 23 '17 at 16:15
source share

In my case, Xcode was tired and could not start the application with this message due to an unsuccessful statement (which was installed by our code).

Working on another device showed an assertion error, which we were able to fix, and everything returned to normal.

0
May 01 '17 at 10:57
source share

In my case, it was InterfaceBuilder. I copied some views from another ViewController, which messed up the restrictions.

In InterfaceBuilder, I had a red arrow error on the ViewController.

At runtime, the application crashed.

0
Oct 25 '17 at 10:01
source share

In my case, the application crashed because I did not set the target membership in the storyboard.

0
Nov 30 '17 at 19:44
source share

In my case, the Build Settings project contained several non-existent directories for Framework Search Paths and Library Search Paths .

0
Jan 26 '18 at 18:11
source share

I had two problems:

1) My target did not have a view controller that was used in the storyboard file.

2) My storyboard was about 3 years old, I had to recreate one of the view controllers in the tab bar controller (it only had UITextField on it, and I still don't know why it didn't work)

0
Feb 27 '18 at 5:39
source share

Another possible reason:

In my case, I had xib and it called Bundle.main.loadNibNamed(... at that moment it Bundle.main.loadNibNamed(... All my IBOutlets and IBActions seemed fine. In the end, I noticed that nib really it loads, but then when I tried to access the first (and only) view ( nib.first ) that didn’t work, actually nib.count returned a very large integer (max int?) Instead of the expected 1 I tried to re-add kind, but still no luck.

In the end, I deleted the entire xib file and ran it again (but I saved some views in my clipboard so that I could paste them instead of having to xib them again).

It worked!

0
Mar 16 '18 at 9:19
source share

This can happen if you have a table and you forget to assign UITableViewDelegate and UITableViewDataSource to the class.

0
May 05 '19 at 16:30
source share
  • one
  • 2



All Articles