[ad_1]
import UIKit
import Toolbar
class ViewController: UIViewController {
lazy var toolbar: Toolbar = {
let toolbar: Toolbar = Toolbar([
Toolbar.Item(title: "BUTTON", target: nil, action: #selector(test(_:))),
Toolbar.Item(title: "BUTTON", target: nil, action: nil),
Toolbar.Item(title: "BUTTON", target: nil, action: nil)
])
return toolbar
}()
override func viewDidLoad() {
tremendous.viewDidLoad()
self.view.backgroundColor = .systemBackground
self.view.addSubview(self.toolbar)
}
@objc func check(_ sender: Any) {
print("hi there")
}
}
After I press the primary toolbar button the app crashes with:
*** Terminating app as a result of uncaught exception 'NSInvalidArgumentException', motive: '-[NSNull test:]: unrecognized selector despatched to occasion 0x1de715eb0'
terminating with uncaught exception of sort NSException
CoreSimulator 802.6 - Gadget: iPhone 13 mini (41207433-2958-4380-93E0-D0448B566794) - Runtime: iOS 15.4 (19E240) - DeviceType: iPhone 13 mini
(lldb)
I am unable to determine how I’m calling the check perform incorrectly?
[ad_2]
