Outputs in UIViewController nil in viewdidload

I have a UIViewController with output for tableView

@IBOutlet weak var tableView: UITableView! 

When I try to access the tableView variable in viewDidload , it throws an error saying that tableView is nil .

Everything seems to be configured in the interface builder. The class for File Owner is installed in my custom class, and the output of tableView is also configured. What could be wrong here, why is the tableView variable still missing even inside viewDidLoad?

+7
ios swift interface-builder
source share
1 answer

Did you type this exit code without creating a link?

If you did, this is your problem. Go back to your storyboard, switch to editor assistant mode and CTRL + drag from UITableView to @IBOutlet weak var tableView: UITableView!

Make sure you have the FILLED IN circle to the left of your var, similar to this. Filled in circle

+3
source share

All Articles