简体   繁体   中英

Can't connect TableView @IBOutlet to ViewController in Swift 2

I am building an app in which I want to press an annotation button and a TableViewCell will pop up. The problem is, when I try to create an @IBOutlet with control+ drag, to ViewController , it doesn't work. Also if I simply write the code : @IBOutlet weak var tableView: UITableView! on ViewController , when I run the app and hit the button, it crashes. What should I do?

Thanks in advance!

Chris,refer this image.Maybe it helps.

在此输入图像描述

在此输入图像描述

Make sure the given class in the Identity Inspector matches your class name.

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM