I created a drop-down menu with 2 buttons in the menu that when pressed, segue you to a different page. I have set up the information to segue to the "Expense Report" page using the ExpenseBTN, but when I run the simulation and try to click the ExpenseBTN it gives me a “Thread 1: signal SIGABRT” error. How do I solve this? Attached is my code
import UIKit
class SecondViewController: UIViewController {
@IBOutlet var Buttons: [UIButton]!
@IBAction func ExpenseBTNpressed(_ sender: UIButton) {
self.performSegue(withIdentifier: "ToExpenseReport", sender: self)
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
@IBAction func HandleSelection(_ sender: UIButton) {
Buttons.forEach { (button) in
UIView.animate(withDuration: 0.3, animations: {
button.isHidden = !button.isHidden
self.view.layoutIfNeeded()
})
}
}
@IBAction func ButtonTapped(_ sender: UIButton) {
}
}
Resulting in:
2021-09-01 13:46:45.408799-0400 mmmmm[8779:945391] Failed to set () user defined inspected property on (UIView): [<UIView 0x7f81507102e0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key .
2021-09-01 13:46:51.142036-0400 mmmmm[8779:945391] -[mmmmm.SecondViewController ExpenseBTN:]: unrecognized selector sent to instance 0x7f815060e910
2021-09-01 13:46:51.148679-0400 mmmmm[8779:945391] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[mmmmm.SecondViewController ExpenseBTN:]: unrecognized selector sent to instance 0x7f815060e910'
*** First throw call stack:
(
0 CoreFoundation 0x000000010e3851e6 __exceptionPreprocess + 294
1 libobjc.A.dylib 0x000000010a7eb031 objc_exception_throw + 48
2 CoreFoundation 0x000000010e406784 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 UIKit 0x000000010b2b56db -[UIResponder doesNotRecognizeSelector:] + 295
4 CoreFoundation 0x000000010e307898 ___forwarding___ + 1432
5 CoreFoundation 0x000000010e307278 _CF_forwarding_prep_0 + 120
6 UIKit 0x000000010b0883e8 -[UIApplication sendAction:to:from:forEvent:] + 83
7 UIKit 0x000000010b2037a4 -[UIControl sendAction:to:forEvent:] + 67
8 UIKit 0x000000010b203ac1 -[UIControl _sendActionsForEvents:withEvent:] + 450
9 UIKit 0x000000010b202a09 -[UIControl touchesEnded:withEvent:] + 580
10 UIKit 0x000000010b0fd0bf -[UIWindow _sendTouchesForEvent:] + 2729
11 UIKit 0x000000010b0fe7c1 -[UIWindow sendEvent:] + 4086
12 UIKit 0x000000010b0a2310 -[UIApplication sendEvent:] + 352
13 UIKit 0x000000010b9e36af __dispatchPreprocessedEventFromEventQueue + 2796
14 UIKit 0x000000010b9e62c4 __handleEventQueueInternal + 5949
15 CoreFoundation 0x000000010e327bb1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
16 CoreFoundation 0x000000010e30c4af __CFRunLoopDoSources0 + 271
17 CoreFoundation 0x000000010e30ba6f __CFRunLoopRun + 1263
18 CoreFoundation 0x000000010e30b30b CFRunLoopRunSpecific + 635
19 GraphicsServices 0x0000000110c7da73 GSEventRunModal + 62
20 UIKit 0x000000010b087057 UIApplicationMain + 159
21 mmmmm 0x0000000109eda1c7 main + 55
22 libdyld.dylib 0x000000010f566955 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)