4

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!

Nikunj
  • 655
  • 3
  • 13
  • 25
Chris
  • 125
  • 1
  • 7

2 Answers2

5

Chris,refer this image.Maybe it helps.

enter image description here

enter image description here

Henson Fang
  • 1,177
  • 7
  • 30
  • Although I am using Storyboard and I think you can't have both Placeholders and a Storyboard, you have to choose either when you start a project – Chris Dec 18 '15 at 10:29
  • 1
    This helped me. New to iOS swift development and was stuck on this error for hours. Thank You sir. – user3132107 May 08 '17 at 13:53
1

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

enter image description here

Duc
  • 650
  • 5
  • 10
  • Yep, I tried that, But it is not the same identity, and when i change it, it changes back. It is messed up but I don't know in which part. I have the ViewController and a separate class "TableViewController that I link with with TableViewController. Apart from that, nothing else that could affect it – Chris Dec 18 '15 at 08:38