0

I deleted view's referencing outlet (File's owner), I received an error when I load the view. I am wondering why we need to set the referencing outlet?

Adam Lee
  • 24,710
  • 51
  • 156
  • 236

2 Answers2

1

Fileowner is used to store reference to interface builder components, so that it can communicate with interface objects when view loaded or when required in code. It is the connection between the IB and its controller. So, Fileowner outlet must be set to display IB objects in iOS. If you remove the top level Outlet application will fail to communicate with IB and will crash.

Ashwani
  • 3,463
  • 1
  • 24
  • 31
0

The view controller (which appears as "File's owner") needs an outlet for its view property, which should be connected to the top-level view in your XIB. If there is no outlet, the view will be nil. That's just how it works. There could be multiple top-level views in your XIB, so you need to make the appropriate connection.

Mike Weller
  • 45,401
  • 15
  • 131
  • 151