UIPickerView: unexpectedly found nil while unwrapping an Optional value
问题 I am trying to implement a UIPickerView to my App. Though I haven't got an error, when I run the app it crashes with following error: unexpectedly found nil while unwrapping an Optional value class LobbyViewController: UIViewController { @IBOutlet weak var textfield: UITextField! var picker: UIPickerView! var radius = [2, 5, 10, 15, 20, 25, 50, 100, 1000] override func viewDidLoad() { super.viewDidLoad() picker.dataSource = self picker.delegate = self self.textfield.inputView = picker }