Я хочу создать выпадающее меню в swift, пробуя следующий код:
import UIKit
class DataUser: UIViewController {
@IBOutlet weak var btnDtop: UIButton!
@IBOutlet weak var tblView: UITableView!
var movinghouses = ["apple","coooasnk","scnaon","dojcncn"]
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
@IBAction func onClickDropButton(_ sender: Any) {
}
}
extension DataUser : UITableViewDelegate, UITableViewDataSource{
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return movinghouses.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
cell.textLabel?.text = movinghouses[indexPath.row]
return cell
}
}
Когда я это делаю, в коде возникает ошибка, которая гласит: «Поток 1: сигнал SIGABR».
Как я мог это исправить?